Using characteristics in skd. Using characteristics in skd Changing the order of columns

Good day, dear readers of the blog site! Last time, we already touched on the topic, which talked about the use of the function. And today, in the first of this series of articles, we will learn what are data composition field roles for, and also consider examples of filling these roles.

The role of the SKD field indicates what is this field. Each field role can contain its own property. For example, it has a numeric value and contains the number of the period, if the field is a period. If the value of the "Period" property is 0 (zero), then this means that this field is not a period. Or the "Dimension" property - contains a sign that the field is a dimension. If the field is a dimension, then this information is used when calculating the totals for the remainder fields.

You can specify a role for each data composition schema field. Roles affect the correctness of the calculation of residuals. In particular, the initial and final balance for some table. If the virtual table "Balances and Turnovers" is selected in the query, then the initial and final balances are calculated according to a complex algorithm, especially if we use additional reversals by period.

But if all this works correctly in queries, according to the set of output fields, then things are a little worse in data composition. After all, we do not know which fields the user will actually select. Everything will depend on the configuration of his version of the report, which he can change at any time. Therefore, the data composition system has its own mechanism for calculating the initial and final residuals for a certain data set, and roles are used accordingly for this. Let's open it and see that for each field you can set roles.

Let's add a query dataset. To do this, we need to make the root element "Query Builder" active. Let's turn to the virtual table "Balances and Turnovers" of the accumulation register. What do we see?

As you can see from the illustration above, we can see that for some fields the role has been filled. This happened because we have the "AutoComplete" flag set. But this is not always possible, so sometimes you have to set the role manually. Let's see a couple of examples.

Let's assume that in the query we use , for example, we use the query language operator "SELECT". Let's describe this condition:

CHOICE WHEN Remains of Goods Remains and Turnovers.Nomenclature = Value(Catalog.Nomenclature.EmptyReference) THEN Value(Directory.Nomenclature.Shampoo) ELSE Remains of GoodsResidualsAnd Turnovers.Nomenclature END

This entry means that if the nomenclature corresponds to a null reference (we refer to the function value reference "Nomenclature", a null reference), then the value of the predefined element will be returned. Let's assume that in our configuration there is such a predefined element and it is called "Shampoo". Otherwise, we return the value of the item itself. We get the following:

As you can see, for the "Nomenclature" field, the role was not filled. But as you can see in the image, in fact, we do not have a role set for the “Field1” field, and in this case the remainder will not be correctly calculated.

There are other examples where the role cannot be set on its own. For example, this is the use, that is, a certain table of values ​​is fed into the input, for example, loaded from another database, and the remainders need to be calculated from it. In this case, we must assign roles ourselves. How this is done, we will consider in.

At the end of the article I want to advise you free from Anatoly Sotnikov. This is a course from an experienced programmer. He will show you on a separate basis how to build reports in the ACS. You just need to listen carefully and remember! You will receive answers to questions such as:
  • How to create a simple list report?
  • What are the Field, Path, and Title columns on the Fields tab for?
  • What are the restrictions on layout fields?
  • How to properly set up roles?
  • What are the roles for layout fields?
  • Where can I find the data layout tab in a query?
  • How to configure parameters in SKD?
  • Further more interesting...
Perhaps you should not try to surf the Internet yourself in search of the necessary information? Moreover, everything is ready for use. Just get started! All the details about what is in the free video tutorials

Access control and management system(ACS) - a set of compatible hardware and software aimed at restricting and authorizing the access of people, vehicles and other objects to (from) premises, buildings, zones and territories.

ACS includes:

Standardization

  • In Russia, there is a state standard for ACS: GOST R 51241-98 ("Means and systems for access control and management. Classification. General technical requirements. Test methods.").
  • In the industry, there are well-established standard ways of solving certain problems. These include the use of EIA-485 (RS-485) for data transfer between controllers and software, the use of Wiegand or 1-Wire protocols for data transfer from the UVIP to the ACS controller.

Place of ACS in an intelligent building

ACS can be interfaced with other automation systems, for example

  • With the Video Surveillance system for combining archives of system events, transmitting notifications to the video surveillance system about the need to start recording, turn the camera to record the consequences of a recorded suspicious event.
  • With a fire and security alarm system to restrict access to guarded premises, to automatically remove and arm premises, to automatically unblock the control panel in case of a fire alarm.

At especially critical facilities, the network of ACS devices is performed physically unconnected with other information networks.

Links

  • GOST R 51241-98 ("Means and systems for access control and management. Classification. General technical requirements. Test methods.")

Wikimedia Foundation. 2010 .

See what "SKD" is in other dictionaries:

    SKD- social and cultural activity SKD synthetic rubber divinyl Dictionary: S. Fadeev. Dictionary of abbreviations of the modern Russian language. S. Pb.: Politekhnika, 1997. 527 p. SKD balance final debit accounting. fin…

    SKD RF- SKD SKD RF Union of Concert Workers of the Russian Federation, music, organization, RF SKD Source: http://news.mail.ru/news.html?396588 ... Dictionary of abbreviations and abbreviations

    SKD-L- divinyl synthetic rubber on a lithium catalyst, oil, chem. Source: http://fs.rts.ru/content/annualreports/517/3/godovoy report 2009 eng.pdf … Dictionary of abbreviations and abbreviations

    SKD-N- divinyl synthetic rubber on neodymium catalyst Source: http://www.avias.com/news/2004/06/16/79836.html … Dictionary of abbreviations and abbreviations

    SKD- Abbr.: Simulation of ebullient activity. This is the name of the Department of Social and Cultural Activities at the Humanitarian University of Trade Unions (Fuchik St., 15) ... Dictionary of the Petersburger

    SKD- self-propelled harvester double-drum beet harvester disk supercritical pressure synthetic rubber divinyl access control system access control system Council of Peasants' Deputies Union of Constitutional Democrats (RF) ... ... Dictionary of abbreviations of the Russian language

    SKD Full name Football club SKD Samara Founded in 1989? Competed ... Wikipedia

    SKD Full name Football club SKD Samara Founded in 1989? Competition second league, zone "Center" 1995 15 ... Wikipedia

    RNMCNT and SKD- RSMTs NT and SKD Republican Scientific and Methodological Center of Folk Art and Social and Cultural Activities named after A.E. A.E. Kulakovsky Yakutsk, RS (Y) http://rnmc.ykt.ru/​ Yakutsk, education and ... ... Dictionary of abbreviations and abbreviations

    RSMC NT and SKD- RNMTsNT and SKD RNMTs NT and SKD Republican Scientific and Methodological Center of Folk Art and Socio-Cultural Activities named after A.E. A.E. Kulakovsky, Yakutsk, RS (Y) http://rnmc.ykt.ru/​ Yakutsk, ... ... Dictionary of abbreviations and abbreviations

Books

  • , Deev V.I. Category: Textbooks for universities Series: Universities of Russia Publisher: URAIT, Manufacturer: URAIT,
  • Nuclear reactors with water of supercritical pressure (bases of thermal calculation). Textbook for universities, Deev V.I. , Thermodynamic cycles and thermal diagrams of nuclear power units with nuclear reactors of the 4th generation VVER SKD are considered. The main characteristics and designs of this type are given ... Category: Textbooks: add. benefits Series: Universities of Russia Publisher:

An example will be given on the configuration "Manufacturing Enterprise Management" version 1.3. In the infobase, for all elements of the "Organizations" directory, the properties "Main warehouse", "Associated counterparty" and "Country of location" have been added. We need to create a report in the data composition system (SKS), in which we can impose a selection on additional characteristics of organizations.

In this case, we will use the standard ACS functionality to work with the characteristics of objects. We will also consider a feature of developing such reports, namely, the inability to use additional characteristics in the data composition schema constructor in the "Configurator" mode. The latter does not allow the use of characteristic fields in setting up output fields in the report, selections, grouping in the report structure, and so on.

Create a report and set up characteristics

Let's create a simple report. It will have one dataset with the following query:

QueryText = " SELECT | Organizations . Link AS Organization,| Organizations . TIN,| Organizations . checkpoint |FROM Directory" ;

The report structure will only display detail records with all fields selectable in the query. In the constructor, the report structure setting will look like this:

The screenshot below shows the output of the report with the current settings.

Great. Now let's move on to setting the characteristics, but before that I will remind you in general terms of the operation of the characteristics mechanism in most typical configurations, including soft starters. Several configuration objects are used for this.

  1. Plan of types of characteristics "Properties of Objects".
  2. Information register "ObjectPropertyValues".

Graphically, the relationship between an infobase object and its characteristics can be represented as follows:

Let's describe the scheme in more detail. The "ObjectPropertyValues" information register in the "Object" dimension contains a reference to the infobase element for which the property is stored. In our example, this is a link to the "Organizations" directory element. All possible properties of an object are defined in the plan of types of characteristics (PVC) "Properties of Objects". The characteristic value stored in the information register depends on the available data types for the characteristic type plan element recorded in the Property dimension. This description should only give a general idea of ​​the mechanism of the add. properties. In practice, it is more difficult.

Now let's move on to setting the characteristics in the data composition schema. To do this, launch the query builder and go to the "Characteristics" tab. Here you need to add a field for linking the infobase object with tables of properties and property values. Earlier, we considered the scheme of communication between configuration objects for storing additional. properties/characteristics. Based on this information, the setup will be as follows:

After that, the request for a data set will be supplemented with instructions for obtaining the characteristics of objects.

" CHOOSE | Organizations . Link AS Organization,| Organizations . TIN,| Organizations . checkpoint |FROM| Directory . Organizations AS Organizations | // Add. instructions for obtaining characteristics |(SPECIFICATIONS| TYPE (Handbook. Organizations) | TYPES OF CHARACTERISTICS Plan of Types of Characteristics. PropertiesObjects | FIELD KEY Link | FIELD NAME Description | FIELDVALUETypeValue | VALUES OF CHARACTERISTICS Register of information. ValuesPropertiesObjects | FIELD OBJECT Object | POLEVIDA Property | USEFUL Value )"

That's all. The report functionality now allows you to select fields of additional characteristics in the report (output fields, filters, etc.). But there is one BUT. We can use these fields in report settings only in 1C:Enterprise mode. In the configurator, we cannot see the characteristics fields, which is logical, because the characteristics are entered by the user and stored in the infobase.

But if there is a need, we can add characteristic fields, for example, to the selection before opening it. Let's consider a small example.

Programmatic work with characteristics

When opening the report form, execute the following program code:

CurrentSettings = SettingsComposer. Settings; Selections Collection = CurrentSettings. Selection. Elements; // Adding selection by add. requisites of the item "Main warehouse". [ Main warehouse] // Adding selection by add. requisites of the nomenclature "Country of location" NewEl = Selections Collection. Add(Type(" Data Layout Selection Element" ) ) ; NewEl.ComparisonType = DataCompositionComparisonType. Equal to; NewEl.LeftValue = . [ Location country]" ) ; NewEl. Usage = False ; // Adding selection by add. requisites of the nomenclature "Associated counterparty" NewEl = Selections Collection. Add(Type(" Data Layout Selection Element" ) ) ; NewEl.ComparisonType = DataCompositionComparisonType. Equals; NewEl.LeftValue = NewDataCompositionField(" Organization . [ Related counterparty]" ) ; NewEl. Usage = False ;

Then if we look at the report selection in the 1C:Enterprise mode, we will see the following picture:

Thus, we programmatically added selection by additional characteristics of the "Organizations" directory, despite the fact that these fields were not available in the ACS constructor. Notice the syntax for defining a data composition field.

New DataCompositionField(" Organization . [ Related counterparty]" ) ,

namely, the text "[Related counterparty]". If we write like this:

New DataCompositionField(" Organization . Related Counterparty" ) ,

then, when running the report, the ACS will incorrectly determine the layout fields. In the settings, the selection fields will be highlighted as incorrect:

For additional properties and attributes that are not available in the ACS constructor, the following syntax must be used when programmatically accessing:

New DataCompositionField(" . " )

Thus, we can set report settings even if the fields are not available in the ACS constructor.

Conclusion

Using the characteristics setting in the ACS makes it possible to significantly simplify the development of complex reports. Despite some shortcomings in the work, such as the inability to configure the selection for additional. properties in the constructor, etc., the characteristics mechanism can be considered a significant step in simplifying the development of reports in the 1C:Enterprise system.

In the article, we have considered far from all the possibilities of characteristics in ACS. The following possibilities remained outside the scope of the article: arbitrary definition of data sources, both for properties and for characteristic values, as well as selection by owner for all available characteristics in the infobase, and much more. The topic is large, there is much to expand the circle of their knowledge.

One of the most important areas of business software is reporting. How easy it is to customize an existing report to the changing needs of business (and legislation) or make a new one may depend (and not in a figurative sense!) The fate of the business, whether it is a report for the tax office or a diagram of the dependence of demand for goods on the season and other factors . A powerful and flexible reporting system that allows you to easily extract the right data from the system, present it in an understandable form, allowing the end user to reconfigure the standard report to see the data in a new light - this is the ideal that every business system should strive for.

In the 1C:Enterprise platform, a mechanism called the Data Composition System (ACS for short) is responsible for generating reports. In this article, we will try to give a brief description of the idea and architecture of the ACS mechanism and its capabilities.


ACS is a mechanism based on the declarative description of reports. ACS is designed to build reports and display information that has a complex structure. By the way, in addition to developing reports, the ACS mechanism is also used in 1C:Enterprise in a dynamic list, a tool for displaying list information with rich functionality (displaying flat and hierarchical lists, conditional row formatting, grouping, etc.).

A bit of history

In the very first version of the 1C:Enterprise 8 platform, version 8.0, reports were made as follows:
  1. One or more queries were written in the 1C query language (SQL-like language, more about it below).
  2. Code was written that transferred the results of executed queries to a spreadsheet document or chart. The code could also do work that cannot be done in a query - for example, it calculated values ​​using the built-in 1C language.
The approach is straightforward, but not the most convenient - there are a minimum of visual settings, everything has to be programmed hand-to-hand. And one of the trump cards at that time of the completely new 1C:Enterprise 8 platform was the minimization of the amount of code in the application solution that needs to be written manually, in particular, due to visual design. It would be logical to follow the same path in the reporting mechanism. This was done by developing a new mechanism - the Data Composition System.

One of the ideas that formed the basis of the ACS was the flexibility and customization of reports, which is available to both the developer and the end user. Ideally, we would like to give the end user access to the same set of report design tools as the developer. It would be logical to make a single set of tools available to everyone. Well, since the tools involve the participation of the end user, it means that the use of programming in them should be removed to a minimum (best of all, completely eliminated), and visual settings should be used to the maximum.

Formulation of the problem

The task before the development team was this - to make a reporting system based not on an algorithmic (ie, through writing code), but on a declarative approach to creating reports. And we believe that the problem has been successfully solved. In our experience, about 80% of the required reporting can be implemented using ACS without a single line of code (except for writing formulas for calculated fields), for the most part - through visual settings.
The development of the first version of the ACS took about 5 man-years.

Two languages

Two languages ​​are involved in creating reports. One is the query language used to fetch the data. The second is the data composition expression language, designed to write expressions used in various parts of the system, for example, in data composition settings, to describe custom field expressions.

Query Language

The query language is based on SQL and is easily mastered by those who know SQL. Request example:

It is easy to see analogues of standard SQL query sections - SELECT, FROM, GROUP BY, ORDER BY.

At the same time, the query language contains a significant number of extensions aimed at reflecting the specifics of financial and economic tasks and at the maximum reduction in efforts to develop applied solutions:

  • Referencing fields through a dot. If the fields of any table are of a reference type (they store links to objects of another table), the developer can refer to them in the query text through ".", while the number of nesting levels of such links is not limited by the system (for example, Customer Order.Agreement.Organization. Telephone).
  • Multidimensional and multilevel formation of results. Totals and subtotals are formed taking into account grouping and hierarchy, levels can be bypassed in an arbitrary order with summing up subtotals, the correct construction of totals by time dimensions is ensured.
  • Support for virtual tables. The virtual tables provided by the system allow you to get almost ready-made data for most application tasks without the need to write complex queries. Thus, a virtual table can provide data on the balance of goods in the context of periods at a certain point in time. At the same time, virtual tables make the most of the stored information, for example, previously calculated totals, etc.
  • Temporary tables. The query language allows you to use temporary tables in queries. With their help, you can improve the performance of queries, in some cases reduce the number of locks, and make the query text easier to read.
  • batch requests. For more convenient work with temporary tables, the query language supports working with batch queries - thus, the creation of a temporary table and its use are placed in one query. A batch request is a sequence of requests separated by a semicolon (";"). The requests in the batch are executed one after the other. The result of executing a batch query, depending on the method used, will be either the result returned by the last query of the batch, or an array of the results of all the batch requests in the order in which the requests in the batch follow.
  • Getting reference field views. Each object table (in which a directory or document is stored) has a virtual field - "Representation". This field contains a textual representation of the object and makes the work of the reporter easier. So, for a document, this field contains all the key information - the name of the document type, its number and date (for example, "Sale 000000003 from 07/06/2017 17:49:14"), saving the developer from writing a calculated field.
  • and etc.
The query engine automatically modifies the query, taking into account the roles of the user on whose behalf the query is executed (i.e., the user will see only the data that he has the right to see) and functional options (i.e., in accordance with the one configured in the application solution functionality).

There are also special query language extensions for SKD. The expansion is carried out using special syntax instructions enclosed in curly braces and placed directly in the request text. With the help of extensions, the developer determines what operations the end user will be able to perform by customizing the report.

For example:

  • CHOOSE. This sentence describes the fields that the user will be able to select for output. After this keyword, aliases of fields from the main query selection list, which will be available for customization, are listed separated by commas. Example: (SELECT Nomenclature, Warehouse)
  • WHERE. Describes the fields on which the user can apply selection. This proposal uses table fields. The use of select list field aliases is not allowed. Each union part can contain its own WHERE element. Examples: (WHERE Nomenclature.*, Warehouse ), (WHERE Document.Date >= &StartDate, Document.Date<= &ДатаКонца}
  • and etc.
An example of using extensions:

Data Composition Expression Language

The data composition expression language is designed to write expressions used, in particular, to describe custom field expressions. ACS allows you to define custom fields in a report using either your own expressions or sets of options with conditions for their selection (analogous to CASE in SQL). Custom fields are analogous to calculated fields. They can be set both in the configurator and in 1C:Enterprise mode, but functions of common modules cannot be used in custom field expressions. Therefore, custom fields are more for the user than for the developer.

Example:

The process of creating a report on the ACS

When creating a report, we need to create a layout that defines how the data will be displayed in the report. You can create a layout based on a data composition schema. The data composition schema describes the essence of the data that is provided to the report (where to get the data from and how you can control its composition). The data composition scheme is the basis on which all kinds of reports can be generated. The data composition scheme may contain:
  • request text with data composition system instructions;
  • description of several data sets;
  • a detailed description of the available fields;
  • description of relationships between several data sets;
  • description of data acquisition parameters;
  • description of field layouts and groupings;
  • and etc.

For example, you can add a query to the data composition scheme as a data set, and call the query constructor, which allows you to graphically compose a query of arbitrary complexity:

The result of running the query builder will be the text of the query (in the 1C:Enterprise query language). This text can be manually adjusted if necessary:

There can be several data sets in a data composition scheme, data sets can be linked in a layout in an arbitrary way, calculated fields can be added, report parameters can be set, etc. It is worth mentioning an interesting feature of the query mechanism in 1C:Enterprise. The queries are eventually translated into a dialect of SQL specific to the DBMS that the application is directly working with. In general, we try to use the capabilities of DBMS servers to the maximum (we are limited by the fact that we use only those capabilities that are simultaneously available in all DBMS supported by the 1C:Enterprise platform - MS SQL, Oracle, IBM DB2, PostgreSQL). Thus, at the query level in calculated fields, we can use only those functions that are translated into SQL.

But at the data composition scheme level, we can already add custom fields and use functions in them in the built-in 1C development language (including those written by us), which greatly expands the capabilities of reports. Technically, it looks like this - everything that can be translated into SQL is translated into SQL, the query is executed at the DBMS level, the query results are placed in the memory of the 1C application server, and the ACS calculates the values ​​of calculated fields for each record, whose formulas are written in 1C language.


Adding Custom Fields

You can add any number of tables and charts to the report:


Report Designer


Report at run time

With the help of ACS, the user can add complex selections to the report (which will be added to the query in the right places), conditional design (allowing you to format differently - font, color, etc. - output fields depending on their values) and much more .

Briefly describe the process of building and generating a report as follows:

  • The developer at design time with the help of the designer (or at runtime with the help of code) defines the data layout scheme:
    • Text of request/requests
    • Description of calculated fields
    • Relationships between queries (if there are more than one)
    • Report Options
    • Default settings
    • Etc.
  • The above settings are saved in the layout
  • User opens a report
    • Possibly makes additional settings (for example, changes parameter values)
    • Presses the "Generate" button
  • User settings apply to the data composition scheme defined by the developer.
  • An intermediate layout of the data composition is formed, containing instructions on where to get the data from. In particular, queries specified in the layout are corrected. So, fields that are not used in the report are removed from the request (this is done in order to minimize the amount of data received). All fields that are used in calculated field formulas are added to the query.
  • The data composition processor is included in the case. The layout processor executes queries, links data sets, calculates the values ​​of calculated fields and resources, performs grouping. In a word, it does all the calculations that were not performed at the DBMS level.
  • The data output processor launches a query for execution and outputs the received data to a spreadsheet document, chart, etc.


The process of generating a report by the ACS mechanism

We try to minimize the amount of reporting data transferred from the server to the client application. When displaying data in a spreadsheet document, when opening a spreadsheet document, we transfer from the server only those lines that the user sees at the beginning of the document. As the user moves along the lines of the document, the missing data is downloaded from the server to the client.

User settings

All ACS tools are available to both the developer and the end user. But practice has shown that the end user is often frightened by the abundance of tool capabilities. Moreover, in most cases, the end user does not need all the power of settings - it is enough for him to have quick access to setting one or two report parameters (for example, period and counterparty). Starting with a certain version of the platform, the report developer has the opportunity to mark which report settings are available to the user. This is done using the "Include in user settings" checkbox. Also, the report settings now have a "Display mode" flag that takes one of three values:
  • Fast access. The setting will be displayed directly at the top of the report window.
  • Ordinary. The setting will be available through the "Settings" button.
  • Not available. The setting will not be available to the end user.


Setting display mode in design time


Display the setting in Quick Access mode at runtime (under the Generate button)

Development plans

One of the priorities in the development of ACS for us is the simplification of user settings. Our experience shows that for some end users, working with user settings is still a serious job. We take this into account and work in this direction. Accordingly, it will also become easier for developers to work with ACS, because we, as before, want to provide a single toolkit for setting up reports for both the developer and the end user.
Loading...
Top