ACS and external data sources. The data set is an object. Data sets External ACS data

Attention! This is an introductory version of the lesson, the materials of which may be incomplete.

Login to the site as a student

Log in as a student to access school materials

Data composition system 1C 8.3 for beginners: presentation of the report in the form of a diagram

Today we will supplement the report from the last lesson (or rather, a copy of it) with the ability to display the same data in the form of a chart.

Setting a goal

  • Make a copy of the report from the last lesson.
  • Display the same data in chart form.
  • In this case, the series (columns, Y axis) should be products, and the points (X axis) should be customers. The column values ​​(along the Y axis) will be the amount of food that the client ordered.

Changing a copy of the previous report

We make a copy of the report from the last lesson under the name “Lesson 9” and open this copy in the configurator of the “Gastronom” database.

Change the report name to “Lesson 9” and click the “Open data layout diagram” button:

We will not change the data sets - our task is to change their presentation for the user.

Therefore, we immediately go to the “Settings” tab and turn our attention to the left column with report options.

We have not worked with this column before, but today I will tell you what it means.

All the settings that we make on this tab (using the magic wand designer or manually at the bottom) relate to one of the report options, which is highlighted on the left side of the window.

By default, this option is always one and is called “Main”. The trick is that in user mode you can easily switch between these options.

And now we have the main option, in the settings of which it is indicated to display data in the form of a table:

Let's rename this option (by double-clicking) and the main one to “Table”:

Adding a new report option

Now, using the plus sign, we’ll add another option (where we’ll put the setting for displaying data in the form of a chart):

Let’s immediately call this option “Diagram”:

Setting up a new report version

As you can see, the right of this option (we have highlighted it) is empty, that is, there are no settings. Let's create them using our magic wand:

This time we will select the report type "Diagram...":

Select “Quantity” as the fields to display (similar to the table):

As series (Y axis) we indicate the field "Food", and as points (X axis) - the field "Customers":

It turned out like this:

Let's save our report in the configurator and run it in user mode:

We see a table... what is it?! But the point is that you just need to select a different report option. Click on the "Select option..." button and select the "Diagram" option:

The diagram is ready

Let's create the report again:

Great, what a beauty

Reference processing, after completing all the steps in this tutorial

At the end of the module

This concludes our discussion of the basics of a data composition system. I tried to tell and explain, using simple examples, the fundamentals necessary for beginners to work with access control systems.

If in your future ( I advise you to do this after finishing school) there will be a need for a more in-depth study of the data composition system - there is a wonderful book by E. Yu. Khrustaleva “Development of complex reports in 1C: Enterprise 8”.

In this module, you have acquired sufficient knowledge and practical skills to begin reading more serious literature on this topic.

We've done a great job, it's time to relax!

Sometimes, in order to obtain a certain layout result, it is necessary to create links between data sets in the access control system. We will try to talk about when this is needed and how to do it in our article.

The data layout scheme implemented in 1C supports three types of data sources (Fig. 1)

Data sources

The most obvious and frequently used data source by developers is the Query.

The query designer implemented in version 8 of 1C is very convenient, and, in most cases, you can link several tables together and make the necessary groupings and selections directly in it.

In complex cases, when it is required or more appropriate to use the execution of some code (for example, loading data from a third-party file) or when it is not possible to use a query, the “Object” data source comes to the rescue. Arbitrary code executed in the module must have a certain structure at the output that the access control system can access.

The third data source is “Union”. In fact, this source can be considered as one of the types of communication. It combines (combines several tables into one), without matching, but the coincidence of certain fields. That is, if two tables being joined have 3 and 4 rows, respectively, then the resulting data source will have 7 rows.

Formulation of the problem

As a testing ground, we will choose the UPP base, version 1.3.92.3, operating in normal application mode.

We have been given the following task: using only the access control system, create a report that would display a table of purchased items from the document, with prices taken from the file sent by the counterparty.

So we must:

  1. Take the tabular part of the receipt document;
  2. Upload the file to the “Object” data source;
  3. Link these two sources by a certain parameter (in our case this will be code);
  4. Display the resulting table.

Execution Process

Let's go through all the steps listed:

  • We create a query for the tabular part of the receipt document (Fig. 2)

Fig.2

  • Create a data set object (Fig. 3);

Fig.3

Here it is important to pay attention to the “Name of the object containing the data”; this is the name we will have to specify in the code of the report module.

  • We go to the report module and create the “When Composing Result” procedure there (Fig. 4);


Fig.4

We will not describe the procedure for obtaining data from an external file; we will pay attention to that part of the code that must be present in the layout so that we can obtain data for “Data Set 2” (Fig. 5).

Fig.5

Important! When creating an “Object” in procedure code during linking, the value of the StandardProcessing parameter must be False.

Go to the “Data Set Links” tab.

Linking sets

Go to the corresponding tab of the diagram (Fig. 6).

We see a table part that is very similar to the table part that is in the query designer, with some exceptions. The “All” checkbox cannot be checked for the communication source set and communication destination set, but several additional columns have been added.

In dataset relationships, you can only establish a relationship similar to the query constructor's left outer join.

Before creating a connection, let's decide on the purpose of the columns:

  1. The link source is the first data set from which all available values ​​will be taken;
  2. Communication receiver – a set of data from which values ​​corresponding to our condition will be selected;
  3. Source expression – a field or expression of the first data set against which the comparison will occur;
  4. The destination expression is a field or expression of the dependent set;
  5. Parameter – if you specify the parameter name in this field, then communication with the receiver set will be carried out only according to the value specified in the parameter;
  6. List of parameters – determines the possibility of using a list of values ​​as a parameter;
  7. Connection condition – by specifying an expression here using source fields, you can create a condition, the fulfillment of which will serve as a signal to establish a connection;
  8. Initial value – shows the initial value of the connection;
  9. Mandatory Relationship - Determines whether the fields used in the source (set to FALSE) or destination (set to TRUE) are enabled and based on this adds the relationship to the layout.

Thus:

  • The source of communication will be the result of our request;
  • The object will act as a receiver;
  • The source expression will be “NomenclatureCode”;
  • Receiver expression “Nomenclature”;
  • Communication will be mandatory (Fig. 7).

If we had indicated the name of any nomenclature, or its type of reproduction, or something else as a connection condition, we could have obtained a more accurate sample for our task. The result of our actions can be seen in Fig. 8

Fig.8

There was no match for the bottom two lines of the report in the pricing file.

On this tab you can create an unlimited number of data sets. A dataset is a source of data.

There are several types of data sets:

  • Request;
  • An object;
  • An association.

The request is a regular 1C request, only the request language is slightly expanded. For convenience, you can use the query constructor.

An object is an external set of data, such as a table of values.

Union – combining several data sets of query and object types.

In this article, we will briefly go through all the tabs of the data composition schema designer. Data sets On this tab you can create an unlimited number of data sets. A dataset is a source of data. There are several types of data sets: Query; An object; An association. The request is a regular 1C request, only the request language is slightly expanded. For convenience, you can use the query constructor. An object is an external set of data, such as a table of values. Union – combining several data sets of query and object types. Dataset relationships This tab describes the relationships between datasets. Here you can specify which data sets to link and by which fields and with which parameters. The most important thing to remember: in the data composition scheme, when linking sets, a Left join is always used! Calculated fields On this tab you can create additional fields that are not described on the Datasets tab. As expressions for calculations, you can use the data composition expression language, fields from the main data sets, as well as functions of non-global common modules. Resources Resources are the summary data for groupings. On the tab, you can assign fields from datasets as well as calculated fields as a resource. Also, for resources, the expression by which they are calculated is indicated, and it is possible to indicate the grouping by which the expression for resources will be calculated. Based on the resource values, report totals are also calculated. Parameters Data parameters are typically used in a dataset query. All parameters described in the request appear on the Options tab. On this tab you can specify the title, available types, available values ​​and some other things. More details about the parameters a little later. Layouts By default, the layout of the generated report is generated automatically by the data composition system. But the system also allows the developer to design individual areas of the report (fields, groupings, resources...). All individual area layouts created on this tab are associated only with the current report. Nested schemas Nested schemas are used in cases where data from one report needs to be used in another. In other words, we “embed” one data layout scheme into another, indicating a connection over a common field. An example of using nested schemas can be found in this article. Settings On this tab, the developer creates standard settings for report generation. The hierarchical structure is specified at the top of the window. The report generation structure may consist of the following elements: Grouping; Table; Diagram; Nested diagram In the lower part of the window, settings are specified for the entire report and for each element of the report structure. Briefly in the settings tabs: Selected fields – list of fields displayed in the report; Selection – all possible selections of report records; Order – sorting of records in the report; Data parameters – the value of the report parameters; Custom fields – additional report fields created by the user; Conditional formatting – sets the conditional formatting of report records; Other settings – all sorts of additional settings such as: report title, design layout, field layout, etc....

41
I recently made a report with an indefinite number of columns. I didn’t want to tinker with the code, so I decided to do it on the access control system. There was no problem with this, it was necessary to stretch the result onto an arbitrary layout (your own header +... 27
Even though CDS students come across this on the first or second day, it should be in the FAQ section. A simple example of programmatically outputting a report on a layout, using the default settings. 18
//Get the diagram from... 10
When generating reports on the access control system, by default all groupings are expanded, but sometimes it is necessary to show a report with collapsed groupings immediately after generation! This code in the report module allows you to collapse... 9
On this tab you can specify what connections are made between two or more data sets, according to what parameters and conditions..png 1. “Source of connection” - indicates the first set of data, from...