Contacts

1C CCD is unloaded into the values \u200b\u200btable. An example of using an external data source in LCD. Read the registration log

Hey!
Today I want to describe the topic with which without "scuba" you will not disperse :);)

Scuba to the fact that the immersion is quite deep. In the literature, there are few links on this topic and not yet "imparting" in it will not discern. It would not even be prompted to such action;) By the way, in the documentation it was mentioned very badly and inconsistently, you have to refer to third-party literature.

For example, I highly recommend "Development of complex reports in" 1C: Enterprise 8.2 ". Data layout system, (if more specifically, see pp. 224, 267 and 473)

In the CCD there are 2 types of data sources: request, object and association (this thing does not count, it is not a data source, but handler available). See Figure 1:


So, if with a source (set) of data type "request" to us more or less understandable, how to work, then there are difficulties in the "Object" database.

To begin with, I will describe what we want to get at the exit:

Report, user pressed the button " Shape"And the list of nomenclatures appeared (see Fig. 2):

Yes, I made one inaccuracy, namely: there is no button " Shape"But there is a button" new act"(I will explain a little later why it happened;)

Yes Yes! Avenum: This entire list is displayed from the "Object" dataset:

Decision:

  1. Create an external report;
  2. Add layout SCD, let's call it "basic ashamompand";
  3. Add a "object" data set to it, assign the name of the "list of listing" (should be the same as in Fig. 3);
  4. In the report settings, we do not specifically experiment, let it all simply (see Fig. 4)

Ok, half of the case made;)

Now let's generate the basic form of the report (yes, another moment! My configuration works on the usual interface, but I think managed formas You will find a solution;) So, form:

There is a problem here! If you click on the "Shape" button (Fig. 5.), we will see the error!


I dedicated this article to solving this problem!

Catch up the event button "To form" did not work out, so I decided to use the crutch. Launched the configuration in debug mode and tried to find the very "form" button.

Inserted in the form of the "form" procedure, but there are no signs in it, I had to override the action of the "Shape" button before opening the form:


In fig. 8 In addition to changing the form of the form, an example of a query, processing and transmitting generated data into the CCD is given. We study it whiter carefully:

  1. We generate the input data for the CCD;
  2. Initialize the CCD;
  3. We derive the result on the form (pay the same attention to it!).

Recall the scheme of interaction of the data layout system objects:

Data layout diagram in the external report is suitable as a global object in the form method SchemacksPrinky.You can also contact her by name by passing it to the method Receive(see Fig. 8)

The main piece of code is given below:

Request \u003d new request; Request.text \u003d "Choose | Nomenclature. Name as a nomenclature | From | Directory. Substitution as a nomenclature"; Nomenclampscription \u003d query. Fill (). Unload (); Set \u003d new structure ("list of listing", nomenclampscriptions); // SCD \u003d receiving ("BasicCheemComponicid"); SCD \u003d schemecomponovydny; Compmeaker \u003d new folding machine cleancomprisey; Mockacomp \u003d Compmacket. Fill (SCD, SCD. Non-Pumppoune); Processor compensated \u003d new processor committees; Processorcomptees. Initialize (mockup, quoted); conclusion \u003d new processor-in-line resultsComplekdangaDocument; conclusion. InstallationSectoral (elementforms. Result); conclusion. Ensure (processor committee, truth);

Yes! Here's another pleasant moment !!!

IN this exampleAs you can see (see Fig. 2), the output is carried out in a form, and not in Table. document! And it is very good, because we can work with the form (programmatically intercept the events of the form element, make all sorts of chips with Drag and Drop and so on;)

In a tabular document, we can simply display the processed data on the screen and transfer the document management to the user and we cannot influence the further editing process of this content!

See the help system " Field of tabular document ", And I just give an excerpt from the built-in documentation of the system 1c enterprise 8.2:

"The table document field is tabular documentplaced in shape. Along with the manifold of the design capabilities of a tabular document, it allows you to organize the processing of events arising from the selection of cells, pictures, as well as other controls placed in the table document field. "

Okay, as they say, success in battle;)

In my past article, I already wrote that 1C is a paradoxical platform. The data line of data refers to such paradoxes. The CCD is designed to construct complex reports and implies the replacement of "manual" programming of reports to design in multifunctional tools. Opportunity use of SCD appeared in the eighth version, but it took for a long time What an version 8.2 appeared in order to use it in its typical products. On the one hand, the SCD is a multifunctional toolkit using which you can make up very complex reports without a single line of code. However, the SCD has a rather high threshold of entry, study and start to fully use it "from the skill" very hard, for the interface is not entirely intuitive, but the most full manuals Use only in the form of paid literature.

In the process of my study, the CCD arose task. You need to get data from a third-party table of values \u200b\u200busing the query language and continue to operate with these data as similar from the database tables (information information, grouping and so on). In classical format, we would make a request that receives information from the table transferred to the request in the idea of \u200b\u200bthe parameter.

Request \u003d new request (
"CHOOSE
| Table. Namerenclature,
| Table. Slab
| Is
| & TK as table ");
Request. Installation parameter ("TK", TK);

But from the CCD is not so simple. Alas, the operation described above should be done in the data lineup system it is impossible. Nevertheless, the possibility of loading external tables of values \u200b\u200bin the system is implemented.

It is worth making a small lyrical retreat and talk about data sets. Data sets are sources of information from which the SCD receives data that later complains to the report. Data sets are divided into types, basically uses the type "request", in the body of which the programmer writes a request to the database. Type "Object" is used to load data from external objects. In both cases, we have a certain set of fields obtained as a result of the execution of the query or load an external object. Later, these fields can be operated on the "Settings" tab, together with detailed setup Report structure. For the relationship of various sets, the CCD provides the ability to specify the links of data sets in the tab of the same name. These bonds are a direct analogue of the left connection in a classic request. However, it should be noted that requests in any set of data do not "know" about the existence of other data sets, ultimately data sets of data sets will affect the data layout on the structure specified in the Settings tab.

Detail the task to some example. There is a typical report of the calculated statement of the organization of the configuration of the ZEK 8. It is necessary that the types of settlements in the report were grouped by some groups. Correspondence of the video group is stored in the external table of values. To load it in the main data lineup scheme, create a "data set" with the name "Group" (Figure 2). Communication We produce with a "query set" - "accrual" according to the form of calculation (Figure 3). In the "Data Set" - "Accrued" is information on groups, we remove all entries. After, on the Settings tab, we can use the group "Group" field, which is loaded from an external data source (Figure 4). In the report formation function, we complement the loading of external data.

Function to formulate (result \u003d Undefined, ProprietaryShimps \u003d Undefined, Outforming \u003d Truth) Export

// Receiving or forming the desired table of "Group" values \u200b\u200band its entry into the same variable

External \u003d New Structure (); // Create and fill out the external data structure
Foreignized. Enter (groups);

Dangered value \u003d Typical Types. PeresaluppodingPastenerPasteer Project (This Object);
PocillionPurchain \u003d folder settings. Pour settings ();
Typical Types. PouringPrenimenNews (This Object);
Typical Types. The formation of the statement (this object, the result, the data storage, outlook, foreignized);
Folder equipment. InstallationShops (Pouringposal);
Return the result;

Endfunction

In the event that we did a report "from scratch", the reporting code of the report formation would look like this:

Foreign ones) \u003d new structure;
Foreign ones. Put ("groups", group); // Groups - a desired table of values
SchemesComponicida \u003d Receive ("BASICSHEMAKOMPHONDED"); // Our layout with data coman diagram
Settings \u003d schemecomponovydata.
Complosing machine \u003d new fold-shirt-cleaner complex;
MockupComponovka \u003d folder machine. Fill (diagram sticks, settings);
ProcessorComponovydanny \u003d new processorCompon's
ProcessorComponovydny.Initialize (MockComples, external sections);
TABO \u003d New Timber;
Processor Equipment \u003d New processor-in-line results CommonTheldBlocks
Processor exercise. Installation of Document (TABO);
Processor Equipment. Equip (processorCompon);

Read 9660 time

When opening new branches of the company, to calculate the load on the server 1C: enterprises and other tasks, it will be necessary to see the dynamics of users' work in the information base in the form of a chart.

Dynamics need to be shown at the user selected period. As the displayed data will be the number of actions on these users in the context of the clock. Information for such a report can be obtained from registration log.

Consider the phased creation of a similar report and with the help of an external data set, we will construct it on the data layout system.

Read the registration log

And so, we will build a report at the CCD. We will not receive the data using a query from the database, and from the registration log. The method of storing the registration log of the platform wrote in the previous article.

In accordance with the specified period in the report, we need to get all user actions on the data information base. The resulting table is grouped on the user and output in the form of a chart (see Screenshot above).

For information from the registration log, we will use the global context method "unloaded ()". In the event "PrecompronCult" of the created report add the following program code:

Procedure for the precomponsult (document result, data storage, standardworking) standardwork \u003d false; // Disconnect the standard report output - we will display software // Get a plot report, incl. period Settings \u003d folder settings. Obtaining (); // Get the report settings Parameteriod \u003d folder settings. Reception (). Painted. Elements. Find ("Period"). Value; Zhortab \u003d new tables; The downloading \u003d new structure; // Create the registry selection structure // Fill the selection by the period Squeezing. Insert ("data", parameteriod. Dataternal); Squeezing. Insert ("Data", Parameteriod. Data Data); // Set the selection for events Arms \u003d new array; Massigatives. Add ("_ $ Data $ _ . Delete.. New"); Massigations. Add (" _ $ Data $ _ . POST."); Massigations. Add (" _ $ Data $ _ . TotalSperiodUpdate."); Massigations. Add (" _ $ Data $ _ . Unpost."); Massigations. Add (" _ $ Data $ _ . Update."); Withdrawal. Paste (" Event ", Massigatives); // Unload the registration log Unloaded (ZhRAG, arms); // Create and fill in the data for output to the report Jostab. Columns. Add ("time"); Jostab. Columns. Add (" Numbers"); For each page of the jostab cycle p. Time \u003d hour (p. Date); number of quantities \u003d 1; EndCycle; // Group results Jostab. Collapse (" Time name" , " Numbers" ) ; // ..............

The first parameter of the "Unloading agency" method sets the table of values \u200b\u200binto which the result of the sample will be unloaded from the registration log. The second parameter set the filter on the selected entries. Filtre is a structure, the keys in which are the fields for which the selection is established. We use the fields of "data" and "Data" to install the registration log analysis period, as well as the Event field, in which we transmit an array of strings (events names). An event-added event corresponds to the data on the data in the database.

You can read more about the use of the "Unloading Uploads" method in the assistant syntax.

We transfer the table of values \u200b\u200bin the SCD

In order for the CCD to work with the received table of values, you need to do the following:

1) Create a set of data in the layout scheme and set its fields.
2) In the software code of the "Precomplow" module "to register the transmission of the values \u200b\u200bof the values \u200b\u200bin the CD.

// Group results Jostab. Collapse (" Time name" , " Numbers"); Insitoring Valves \u003d New Proprietary AccessoriesCipded; // Create decryption data Complosing machine \u003d new fold-shirt-cleaner complex; // Create a layout layout // Initialize layout layout using data layout circuit // And previously created settings and decryption data SchemacksPrinky \u003d Receive: Basic ashamcomponovkin"); MocktackComponovka \u003d folder package. Perform (schematicpone, settings, data storage); // Scompon the result ProcessorComponovka \u003d new processor components; ProcessorComponovka. Initialize (mock-one, // !!! We pass the table "Zhortab" to the layout processor !!! New Structure (" Logregister", Журраб), policyshifts); document results. Clear (); // Display the result in a tabular document Processor Equipment \u003d New processor-in-line results CommonTheldBlocks CPU. Installertocument (document results); CPU. Output (processor pump); Extrudresses

3) Customize the resources and report structure (see more details in the report file, the link to which is given at the end of the article).

This report settings completed and we can run it in the enterprise mode.

Outcome

The external data source in the CCC is subject to use in reports data from almost any sources, pursuing those data that we cannot get requests.

The use of SCD for such sources allows you to create reports with a flexible settings system, and also allows the user to change the output of the report, its structure. All the possibilities of the data layout system will be involved for such sources to the full.

Download a report from the example you can according to the following link.

Sometimes it happens that the data in the report cannot be obtained using a request or query combination. You have to use any procedures to collect data, and the data is placed in the value table. The question arises - is it possible to use this data in the layout diagram of the data? After all, the skd tool is powerful and convenient. It turns out that you can use the data from the value table as a data source for a report in the LCD and this is not entirely difficult to do this. This article will show the creation of such a report for conventional forms.
So how to create a CC report using data from the values \u200b\u200btable? About everything in order.
First of all, open the configurator and create a new external report.

Open the object module and create a predetermined procedure for a precomponsult (document result, data storage, standardworking)

Inside this procedure, we collect data and form a report.
In the procedure of precomproceptrate, we turn off the standard processing. Standardworking \u003d false;
Then form a table of values \u200b\u200brandomly. The names of the speakers of the table of values \u200b\u200bmust coincide with future data set fields in SCD:


For example, add three data lines. Next, on the steps, create a report output.

  • From the scheme we get the default settings.

  • In the appropriate variable we send data on decoding.

  • We form a layout using a layout layout.

  • We transmit the layout layout to the layout, settings and decryption data.

  • We perform the layout using the layout processor. To do this, we perform the method of processor layout data initialize (). As parameters, we transfer the data layout layout, external data sets (Type: Structure, the key key must match the object name in the data layout circuit, the value is a formed table of values), decryption data.

  • Clean the field of a tabular document.

  • Display the result in a tabular document.
As a result, the following code is obtained:
SchemacksPrinky \u003d Receive ( "BASICASHEMACOMPONDEN"); // Settings \u003d schemesComponicida. // - If you do as shown above (recommended on some resources), then when you change the settings in the client mode // these changes you will not see, because the settings will always be default. As correct - option below Settings \u003d folder settings. Obtaining (); InspectionShoflings \u003d New IntectionCiprunctionCipded; Complosing machine \u003d new fold-shirt-cleaner complex; MockupsComponovka \u003d folder machine. Perform (schemecompnee, settings, policyshifts); External designated \u003d New Structure ( "Occupatic conventions", TZ spelled); ProcessorComponovydanny \u003d new processorCompon's ProcessorComponicidated. Initialize (mock-upcompons, external designated, policyshifters); Documentality. Clear (); Processor Equipment \u003d New processor-in-line results CommonTheldBlocks CPU. Installertocument (document results); CPU. Withdraw (processor complex); Add layout layout layout. The name can be left by default.

Create a data set. To do this, add a new set of data type. In the Name of an object that contains the data contains the name that we pointed out as a key when creating an extra charged structure. Then add the field. Names must accurately match the names of the columns in the values \u200b\u200btable. Next, we can specify valid values, formats, etc.

Add resources if necessary. They will be considered the results. In our case, these are fields quantity and amount.

In the Settings tab using the settings designer, form the default report version

We save our report. Run it in the client and form. An example of executing a CC report using data from the values \u200b\u200btable is shown in the picture.


That's all. Just enough, is it not true?

The resulting report for example can be downloaded

41
Recently did a report with an uncertain number of columns. It was reluctant to mess around with the code, I decided to do at the CCD. This problem did not arise, it was necessary to pull the result on an arbitrary layout (my header + ... 27
Despite the fact that the studies of the CCD meet with this for the first or second day, this should be in the FAQ section. A simple example of a program output on the layout using default settings. // Get a scheme from ... 18
When generating reports to the default CCD, all groups are deployed, but it happens immediately after the formation of showing a report with minimized groupings! This code In the report module allows you to roll ... 10
On this bookmark, you can specify which links are made between two and more data sets, by what parameters and conditions ..png 1. "Communication Source" - indicates the first set of data, from ... 9
That when developing reports is required to have a user with limited rights, the report was formed completely without verifying rights! Especially if RLS is configured, there are several ways to do: 1. Install ...



Did you like the article? Share it