Save value 1s 8.3. Useful Tricks for Managed Forms

Let's consider creating an external report in 1C 8 without using a data composition system. To create an external report, we will use the Accounting 2.0 configuration, the initial data: “Write a report on accounting account 62 in which the turnover for the specified period will be displayed in the context Counterparties And Contracts of counterparties.

1. Create a report

First of all, let's create an external report file; to do this, let's go to 1s 8 in the mode Configurator, let's go to the menu File -> New, or click on the icon new document.

Select the item from the list External report. After creating the external report, give it a Name (for example SimplestReport) and save it to disk. We will also add two details: Beginning of period And End of Period type date, we will need them to limit the time interval for data sampling when generating a report.

2. Create an external report layout

To generate a report in 1C 8, you need a layout, this is a template for displaying data in which all the necessary parameters are set, tables are drawn, etc. Let's add a new layout; to do this, select the item in the report metadata tree Layouts and press the button Add, when creating, select the type for the layout spreadsheet document.

Our layout will have 4 areas:

  • Header - in this area we will display the name of the report, the period for which it was generated and the table header;
  • Counterparty data - in this area we will display data on the counterparty in a table;
  • DataCounterparty Agreement - in this area we will display data on the counterparty agreement in a table;
  • Footer - in this area we will display the total values ​​for the entire report for the Income and Expense fields.

Let's start creating layout areas. In order to create an area in the layout, select the required number of lines and click Menu Table -> Names -> Assign name(Or Ctrl + Shift + N). To the region A cap Let's write the name of the report: Turnover 62 counts, draw using the tool Borders report header, and also set the parameters Beginning of period And End of Period. Using parameters, you can display the necessary data in the report; we will deal with this at the next stage of development, namely when writing the report code. To create a parameter in the layout, select the desired cell, write the name of the parameter in it (without spaces), right-click on it, select the item in the menu that opens Properties. In the cell properties on the tab Layout select padding Parameter.

After this, the parameter name in the cell will be enclosed in angle brackets("<>“). As a result, the area A cap should look like this:

In area DataCounterparty we will create parameters for displaying the name of the counterparty, as well as for income and expenses for account 62, using the tool Borders Let's design the area as a table row.

In area DataCounterparty Agreement Let's create parameters for displaying the name of the contract, as well as for income and expenses for account 62, using the Borders tool we will design the area as a table row. Let's make a small indent before the parameter Counterparty Agreement(this can be done by splitting and merging cells. Right-click on the cell -> Merge or Split cell), it is needed so that the report can see that the line for the contract is lower in the hierarchy than the line for the counterparty.

In area Basement Let's create parameters for income and expense totals.

As a result, we should get a layout like this:

3. Create a report form

To display data, set the formation period and button Form our report will require a form. To create a form, find the item in the external report metadata tree Forms and press the button Add. On the first page of the form designer, you don't need to make any changes, you just need to click the button Further.

On the next page of the designer, select both available details( Beginning of period, End of Period) for placement on the form.

As a result, we will get this form:

But we are not satisfied with it in this form; let’s make some changes to it:

  • Let's drag the button Form from the bottom panel of the report to the top (this will be more convenient for the user);
  • Stretch the shape vertically and horizontally;
  • Let's arrange the fields Beginning of period And End of Period horizontally;
  • Let's add a Spreadsheet Document Field control element to the form (our report will be displayed in it), give it a name TabDoc;
  • Let's create a period selection button (when clicked, a dialog will appear with a convenient choice of the desired period). We won’t write the program code for it yet, so we’ll just place the button next to the period fields.

As a result, our form will look like this:

4. Programming

After creating the report form, let's start programming. First, let's create a procedure for displaying a period selection dialog (we already created a button for this at the previous stage). Right-click on the button and select the menu item Properties, in the button properties go to the tab Events, where using the button with a magnifying glass icon we will create a procedure Button1Press in the form module.

You can switch between the form and its module using the tabs at the bottom of the form

To call the period selection form, we will use the standard procedure Accounting 2.0 from a common module Working with Dialogs - HandlerPeriodSettingPress, you need to pass the report details to it as parameters Beginning of period And End of Period.

Procedure Button1Press(Element) Working with Dialogs.PeriodSettingHandlerPressing(PeriodStart,PeriodEnd); End of Procedure

Now let's move on to writing the code that will generate and display our report. The form module already has a procedure ButtonGeneratePress, which will be executed when the button is pressed Form, that’s where we’ll write our code. Let's start by initializing the necessary variables. First of all, let's create a variable for spreadsheet document fields into which we will output data, this is not necessary, it’s just that the recording of calls to it will become shorter, which means the program code will be more understandable for reading.

TabDoc = FormElements.TabDoc;

Let's get the layout of the external report using the function GetLayout(<ИмяМакета>) , we will pass the name of the layout as a parameter, and if such a layout exists, the function will find it.

Layout = GetLayout("Layout" );

After the layout is received, let's create variables for each of its areas, use the layout method for this GetArea(<ИмяОбласти>) .

AreaHeader = Layout.GetArea("Header" ); AreaDataAccount = Layout.GetArea( "Contractor Data"); AreaDataContract = Layout.GetArea("DataContract" ); AreaFooter = Layout.GetArea("Footer" );

Let's clear the field of the spreadsheet document. This is necessary so that every time a new report is generated, the old data is deleted.

TabDoc.Clear();

Now that the initialization of the variables is complete, let's move on to filling and displaying the layout areas one by one. Let's start with the header. If you remember, we created two parameters in this area Beginning of period And End of Period, we will pass there the values ​​of the report generation period, for this we will use the property Options layout areas.

AreaHeader.Parameters.PeriodStart = PeriodStart; AreaHeader.Parameters.EndPeriod = EndPeriod;

No more actions with the area A cap The manufacturer is not needed, so we will display its field in a spreadsheet document.

TabDoc.Output(AreaHead);

Next, we will write a query to the database, with the help of which we will take the account turnover 62 from the accounting register Self-supporting. Let's define a variable in which our request will be located.

Request = new Request;

Before we start writing the request text, let’s pass the necessary parameters to it. Since we are writing a request for an invoice 62 accounting, then first of all we will create a parameter for it

Request.SetParameter("Account62", Charts of Accounts. Self-supporting. Find By Code("62" ));

It is also necessary to pass the report generation period into the request. Don’t forget that we have special report details for the generation period, and we pass them as parameters.

Request.SetParameter("Start of Period", Start of Period); Request.SetParameter("End of Period", End of Period);

Let's start writing the query text, we will do this using the query designer. In many tutorials they write that you need to be able to write a query both manually and using a constructor, but in practice this is not the case. In the tasks that a 1C programmer constantly faces, the priority is to quickly and efficiently write code, and when writing a query to the database manually, this is almost impossible to achieve; you will spend a lot of precious time correctly reproducing all query structures and finding typos which you did when writing, etc. Therefore, do not waste your time trying to write queries manually, but use the query constructor. It will save your time and allow you to write complex queries without much effort. To start writing the request text, let’s write in code:

Request.Text = "" ;

After that, place the cursor between the quotes, right-click and select Constructor request. The query designer window will open.

Now we need to select the 1C 8 database table we need. We need a virtual table Revolutions accounting register Self-supporting. Let's find it on the left side of the designer window

Let's move it to the area Tables and let's start filling out the parameters. For all virtual query tables there is a special set of parameters that allow you to select the necessary data from the main table (in our case, the main table Accounting Register Self-supporting). Let's open the virtual table parameters window.

Let's fill in the parameters for the period that we passed to the request. To use a parameter in the request text, you should write the symbol before its name ampersand(&)

It remains to fill out the condition for the accounting account. accounting. To do this, find the line in the parameters of the virtual table Account Condition and we'll write there

Account IN HIERARCHY (&Account62)

You can also use the conditions constructor by clicking on the button with three dots.

There is no need to impose any more conditions on the virtual table, so let’s click the button OK in the virtual table parameters window. Next, we need to select the fields we need from the table Self-supporting.Turnover(namely: Counterparty, Counterparty Agreement, Income and Expense). To view the list of fields available in the table we have selected, click the “+” symbol next to its name. After that, drag the required fields to the rightmost area of ​​the query designer, which is called: Fields. If we open the chart of accounts, we will see that for the account 62 analytics on For the counterparty this is Subconto1, and by Counterparty Agreement - Subconto2.

Therefore, from the fields of the virtual table we select Subconto1 And Subconto2. Since we need income and expenses by amount, we also select the fields AmountTurnoverDt And AmountTurnoverKt

Let's fill in the aliases of the fields we have selected; to do this, go to the tab Unions/Aliases and set the required field names.

Since in our report the data will be displayed hierarchically (the Counterparty is on the first level, and all of its contracts are on the second), we will configure the display of data in the hierarchy using Totals. Let's go to the tab in the designer Results. Drag into grouping fields sequentially Counterparty And Counterparty Agreement, and in the final Coming And Consumption.

This completes the work in the query constructor, click the button OK and we see that the text of our request appears in the program code.

Query.Text = "SELECT | Self-supportingTurnover.Subconto1 AS Counterparty, | Self-supportingTurnover.Subconto2 AS Counterparty Agreement, | Self-supportingTurnover.AmountTurnoverDt AS Receipt, | Self-supportingTurnover.AmountTurnoverKt AS Expense|FROM | Accounting Register. Self-accounting. Turnovers (&Beginning of Period, &End of Period, Account IN HIERARCHY (&Account 62),) AS Self-accountingTurnover|RESULTS | AMOUNT(Revenue), | AMOUNT(Expense) |PO | Counterparty, | Counterparty Agreement";

After we have finished writing the request, let's start filling out the areas DataCounterparty, DataAgreementCounterparty And Basement. We will fill all these areas with the data received when executing the request. Since our query contains groupings( Counterparty And Counterparty Agreement) select data from it as follows:

SelectionCounterpart = Request.Execute().Select(BypassQueryResult.ByGrouping);

This way we will receive records with totals for all counterparties.

Before traversing the sample data using a loop, we initialize the variables intended for calculating the overall results for the report:

TotalIncoming = 0; TotalConsumption = 0;

In order for the report data to be displayed with a hierarchy (and rotations along “+“), let’s set the beginning of the auto-grouping of the rows of the spreadsheet document:

TabDoc.StartAutoGroupingRows();

All preparations are completed, now let's start crawling the query results. We will perform the traversal using a loop Bye

While Select Account.Next() Cycle EndCycle ;

At the beginning of the cycle, reset the parameters Coming And Consumption region DataCounterparty. What is it for? Let's imagine a situation where the counterparty Uncle Vasya, income is 10, and expense is 5, and for the next counterparty Uncle Petya there is no income or expense, in this case, if we do not reset the parameters Coming And Consumption, then in line by counterparty Uncle Petya there will be an income of 5 and an expense of 10.

AreaDataAccount.Parameters.Receipt = 0; AreaDataAccount.Parameters.Expense = 0;

After that we fill the area DataCounterparty sample element data

FillPropertyValues(AreaAccountData.Parameters,SelectionAccount);

After filling in the data, you can display the area in spreadsheet document, Since we are using auto-grouping of rows, we need to indicate the level of the row in the grouping (our report will have two levels, for counterparties the first for contracts).

TabDoc.Output(AreaDataAccount,1);

Now for this counterparty we will make a selection according to its contracts.

SelectionCounterparty Agreement = SelectionCounterparty.Select(BypassQueryResult.ByGroups);

We will perform the traversal using a loop Bye.

While SelectionCounterparty Agreement.Next() Loop EndCycle ;

In the cycle for counterparty agreements, let’s reset the parameters Coming And Consumption, fill the area DataContract from the sample and display it in a spreadsheet document at the second level of records.

AreaDataContract.Parameters.Receipt = 0; AreaDataContract.Parameters.Expense = 0; Fill inPropertyValues(AreaDataAgreement.Parameters,SelectionCounterpartyAgreement); TabDoc.Output(AreaDataContract,2);

Also in this cycle, we will add the current values ​​to the variables for calculating the total values ​​for income and expense.

TotalReceipt = TotalReceipt + SelectionCounterpartyAgreement.Receipt; TotalExpense = TotalExpense + SampleCounterparty Agreement.Expense;

This concludes the output of data in the area DataCounterparty, DataAgreementCounterparty completed, all that remains is to complete the auto-grouping of the rows of the spreadsheet document.

TabDoc.FinishAutoGroupingRows();

Full cycles responsible for outputting data to the area DataCounterparty And DataAgreementCounterparty look like this:

TabDoc.StartAutoGroupingRows(); While SelectionAccount.Next() Loop AreaDataAccount.Parameters.Receipt = 0 ; AreaDataAccount.Parameters.Expense = 0 ; FillPropertyValues(AreaAccountData.Parameters,SelectionAccount); TabDoc.Output(AreaDataAccount,1); SelectionCounterparty Agreement = SelectionCounterparty.Select(BypassQueryResult.ByGroups); While SelectionCounterparty Agreement.Next() Loop AreaDataAgreement.Parameters.Receipt = 0 ; AreaDataContract.Parameters.Expense = 0 ; Fill inPropertyValues(AreaDataAgreement.Parameters,SelectionCounterpartyAgreement); TabDoc.Output(AreaDataContract,2); TotalReceipt = TotalReceipt + SelectionCounterpartyAgreement.Receipt; TotalExpense = TotalExpense + SampleCounterparty Agreement.Expense; EndCycle ; EndCycle ; TabDoc.FinishAutoGroupingRows();

It remains to display the final data in the area Basement and output the area itself to spreadsheet document.

AreaBasement.Parameters.TotalIncoming = TotalIncoming; AreaBasement.Parameters.TotalConsumption = TotalConsumption; TabDoc.Output(AreaFooter);

This completes the process of writing an external report for 1C 8 without using an access control system. Now it can be generated in 1C:Enterprise 8 mode and added to the directory ExternalProcessing You can download the report file discussed in the article from .

Watch a video on creating an external printable for a managed application:

Hello to everyone who has recently taken up 1C managed forms.

Although the idea embedded in controlled forms is very interesting, after a fat client several questions arise - the solution to which is very non-trivial.


How to get an External Report/Processing Layout?

ObjectTMP = Form AttributesValue("Object"); Layout = ObjectTMP.GetLayout("MyLayout");

What we used to do with functions (thick client)

Now it’s done like this (thin client/managed forms):

Storage of UserSettingsDynamicLists.Save("ParameterName", "SettingName", Value); Value = Storage of UserSettingsDynamicLists.Load("ParameterName", "SettingsName")

It’s worth clarifying a couple of nuances here:

  1. The example is given for the Trade Management 11.x configuration. UT 11.x has several standard repositories. Standard repositories do not require additional code i.e. may be used "AS IS". The caveat is that not all of these repositories will do what you need :) - just choose the one that will work:
    1. Storage of UserSettingsDynamicLists
    2. FormsDataSettings Storage
    3. General Settings Storage
    4. Storage of UserSettingsReports
    5. System Settings Storage
  2. UT 11 also has a standard storage, the Report Options Storage - a special handler has already been written for it in the configuration, which requires a specific parameter structure. If you wish, you can deal with them yourself.
  3. There is also a Settings Storage object - it is intended for developing your own storages. The nuance here is that this object itself does not do anything; it provides several (empty) handlers in which you need to write code to save the passed values. Where and how to keep it is a purely personal matter for everyone who decides to get in touch with it.


Random selection in controlled forms.

Often for various special treatments it is necessary to have a random selection on the form. In the thick client, we used the Selection object, filled it in programmatically and enjoyed life. In managed forms and the thin client, they took away this opportunity from us, but gave us another one, it looks intimidating, but is very easy to use, and most importantly, you need to write even less code.

  1. We create a form attribute of the type ComposerDataCompositionSettings (or processing attribute, as you like) - let's call it NewSelection (for example)
  2. If we expand New Selection with a cross, then inside we will see the Settings property, and inside Settings we will see Selection - grab the selection with the mouse and drag it onto the form - as a result we will see the form of a standard selection, just like in the good old days...
  3. Initializing the selection - you can’t just fill the selection with elements. To do this you need to take two steps
    1. Create a layout diagram (example) - for those who know how to make ACS diagrams, I’ll explain a simple principle (for those who don’t know, look at the example): We make a basic request (in the ACS diagram) of the form SELECT Nomenclature. Link AS Nomenclature, Nomenclature. Manufacturer AS Manufacturer , Warehouses.Link AS Warehouse FROM Directory.Nomenclature, Directory.Warehouses

      Upon request, the SKD will determine the fields available for selection. If we want some fields to be added automatically to the selection, go to the Settings tab (in the ACS) -> Selection and add fields there to the left side (don’t forget to set the default values). If it’s not clear, look at an example.
      We add the scheme to the processing/report layouts.

    2. Execute the code (on the server - a function with the &OnServer modifier): //Get the schema from processing ObjectTMP = Form AttributesValue("Object"); LayoutScheme = TMP Object.GetLayout("MySettingsLayoutScheme");//Your scheme can be called anything you like //Take the default settings from the LayoutSettings scheme = LayoutScheme.DefaultSettings; //Initialize our selection Address = New UniqueIdentifier(); URLSchema = PlaceInTemporaryStorage(LayoutSchema, Address); SourceSettings = New SourceAvailableSettingsDataComposition(URLSchema); NewSelection.Initialize(SettingsSource); NewSelection.LoadSettings(LayoutSettings);

      The code can be stuffed, for example, into the function OnCreationOnServer(Failure, StandardProcessing)

  4. Using selection - All selection elements are located here: New Selection.Settings.Selection.Elements

    This is a collection, so we traverse it in the standard way

    For each Element FROM New Selection.Settings.Selection.Elements Cycle //Row(Element.LeftValue) is what is on the left in the selection (for example, Item or Warehouse.Name) //Element.RightValue is the selection value (for example, a real item group or warehouse) //Element.Use - True - if there is a checkmark on the selection line //Element.ComparisonType - field of type ComparisonType (For example,ComparisonType.Equal) EndCycle;

PS The article was written for ordinary programmers to make their lives easier. I envy those whose life is already easy.
There will be more goodies - I’ll add them to the article.

Each organization, in order to make timely and correct management decisions, needs operational information about the availability of goods in warehouses, its cost, and sales. Trade organizations work with a large number of items and counterparties, and this requires good setup of analytical accounting and quick acquisition of the required information from its data. M.S. Paskova (an expert from the Laerta company) examines the basic techniques for working with standard reports in the standard solution “1C: Trade Management 8” (rev. 11), built on the basis of a data composition system and gives useful practical recommendations that will be useful to both novice users and for those who switched to it from previous editions.

As the 1C:Enterprise 8 platform develops and the new version 8.2 appears, reports in systems become more and more flexible, and users have more and more opportunities to customize them to their requirements without the help of 1C programmers. New capabilities provided by the data composition system (DCS) allow you to experience the benefits of new capabilities when building reports like never before. And, despite the fact that the report interface has undergone significant changes (compared to edition 10.3 of the “Trade Management” configuration, hereinafter referred to as UT), the report settings are still available to the average user. Let's look at some basic techniques for working with them.

"Quick selections"

The first thing you can pay attention to is the quick selections. They allow you to display data in a report based on certain values ​​of report fields according to the user’s wishes.

For example, let's take the report Analysis of Availability of Products in UT. Let us immediately note that the entire demonstration of the reporting capabilities in UT 11 will take place using the example of two reports:

Selection by some fields can be done either directly in the report form or using a button Settings (Fig. 1).


Rice. 1. Quick selection

In a collumn Type of comparison the user can select different comparison conditions. For example, for the Nomenclature field, you can select the following comparison types:

  • Equals - the report will be built only for the selected item;

  • Not equal - the report will be generated for the entire product range, except for the selected item;

  • On the list - the report will be based on a list of item items;

  • Not on the list - the report will be built on the entire product range, except for selected items;

  • In Group - the report will be built on the entire nomenclature located in the selected folder of the Nomenclature directory;

  • Not in group - the report will be built for the entire nomenclature, except for the items located in the selected folder of the Nomenclature directory;

  • In a group from the list - similar to comparison In the list, only folders in the Nomenclature directory are selected as list values;

  • Not in a group from the list - similar to comparison Not in the list, only folders in the Nomenclature directory are selected as list values.

The checkbox to the left of the selection field indicates that selection for this field is “enabled”, i.e. taken into account by the report. Unchecked fields are not taken into account even though you have selected specific values ​​for these fields.

Depending on the selected type of comparison, the Value column indicates a specific element or folder (group) of the directory, or a list of elements or folders.

An example of a simple change in report settings

To view/change report settings, you need to go to the menu All actions/Change option.


Figure 2. Changing report settings

The settings window for the selected report option opens in front of us (Fig. 3).


Figure 3. Settings window

The report structure is displayed at the top of the window. In essence, this is a visual display of groupings of rows and columns of a report, i.e. in what order the analytics data will be displayed in the report in rows and columns.

At the bottom of the window, information related to the report as a whole is displayed (if the top level is selected in the report structure Report ), or to a specific grouping of report rows or columns (if the grouping is selected Stock or Nomenclature , Characteristic ) settings for information output and field design.

Example 1. In the report Product Availability Analysis remove the grouping by product characteristics and add a new grouping by price group (field Nomenclature. Price group ).

Step 1. We need to remove the grouping by product characteristics, leaving only the grouping by product. To do this, at the top of the report settings window, click on the field Nomenclature, Characteristics . At the bottom of the window, go to the tab Groups (Fig. 4)


Figure 4. Removing grouping by Item Characteristics

Select the field Characteristic and click on the button Delete command panel. Confirm changes to the report settings by clicking the button Finish editing in the lower left corner of the screen.

The result of our actions is presented in Fig. 5. As can be seen from the presented figure, the field Characteristic no longer appears in the report.


Figure 5. Result

Step 2. After removing the characteristic, our task, according to the conditions of the example, will be to add a price group. In essence, this grouping should be at a level lower than the grouping by warehouse, but at a level higher than the grouping by item. Therefore, in the structure of the report we will highlight a grouping Stock . By right-clicking on it, select the command from the context menu New group (Fig. 6.)


Figure 6. Adding grouping by price group

In the window that opens for editing the grouping field, select as the field Nomenclature.Price group (Fig. 7).

Figure 7. Editing a grouping field

Click on the “OK” button. As can be seen from the figure, a new grouping has been added to the report, subordinate to the grouping Stock .

Now let's select the grouping by nomenclature and, without releasing the right mouse button, drag it inside (i.e. below) the grouping by price group . We will get the following structure:

Figure 8. The resulting report structure

Result of running the report:


Figure 9. Result of report setup

Working with custom fields

Let's now take a closer look at the new options for customizing reports in UT.

In the form of editing the structure and settings of the report, pay attention to the tab Custom fields . Previously, we added fields to the report, the list of which was pre-specified by the developer. Using this tab we can create our own fields - Selection field or Expression field .

Example 2. Let's customize the report for ourselves Sales history (report version ). We will display sales data by partners and product range. Let's assume that our company sells goods in Moscow and in the regions. Thus, each client in the information base belongs to a specific geographical region (props Business region directory Partners ). We can easily group sales data in a report by region , but what to do if we are interested in more aggregated statistics, in particular the answer to the question “How many goods were sold in Moscow, and how many in all other regions combined”? This is where “custom fields” come in handy.

Step 1. Open the report. Let's go to the form for setting up the report structure ( All actions/Change option ). Let's delete, one by one, all the groupings previously created in the report - to do this, select each of them and click on the “Delete” button on the command panel, or use the “DEL” key.

Just like in the previous example, let's add a grouping to the report by partner , and then by nomenclature . We already know how to do this, so it won’t take much time. As a result, the report structure will take the following form:


Figure 10. New report structure

Step 2. Let's create a new custom field. Let's open the bookmark Custom fields and execute the command Add/New Select Field.

Figure 11. Adding a new field

Let's give our new field a name - Region in general.


Figure 12. Editing a new custom field

Let's click on the button Add (Fig. 12). In a new line, click on the button in the column Selection . In the selection editing form that appears, add selection by field Partner.Business region . Let's choose the type of comparison Equals , meaning – “Moscow” (Fig. 13)


Figure 13. Editing selection

Click on the “OK” button, and then return to the custom field editing window. Next, you need to click on the button in the column Meaning and in the data type selection list that appears, select Line and write “Moscow” as the value.

Let's repeat the operation. Let's add one more row to the table. This time for selection by field Partner.Business region choose the type of comparison Not equal (Fig. 14).


Figure 14. Selection with comparison type Not equal

Returning to the custom field editing window, in the column Meaning Let's write “Other regions”.


Figure 15. Other regions

Click on the “OK” button. Our new field is ready.

Step 3. Add our new field to the report structure. Selecting the top level with the mouse Report in the structure, add a new grouping. In props Field select “Region generalized” (Fig. 16).


Figure 16. Field selection

Let’s drag the grouping by partner and its subordinate grouping by item inside the newly created one with the mouse to get the following report structure:


Figure 17. New report structure

Let's generate a report and look at the result.


Figure 18. Result of report generation

Selection and sorting

Let's return to the window for editing the report structure and settings and pay attention to the bookmarks Selection And Sorting .


Figure 19. Selection, sorting, conditional design

If the root element is selected in the report structure ( Report ), then the settings made on these tabs will apply to the entire report as a whole. If some report grouping is selected ( Partner , Nomenclature ) – then the settings will affect only it.

Example 3. To report Sales history (report version Revenue and cost of sales ) add selection by field Manager .

Report , let's go to the bookmark Selection .

Manager . Let's set the type of comparison Equals , select “Ivanov Petr Fedorovich” as the value.


Figure 20. Selection by field manager

As a result, only those sales where Ivan Fedorovich Ivanov is indicated as the manager will be included in the report.

Example 4. Let's display the data in the report in descending order of sales revenue.

Open the report settings window, select the root element in the report structure Report , let's go to the bookmark Sorting .

From the list of fields on the left, drag the field to the right with the mouse Revenue . Set the sorting direction Descending .


Figure 21. Sorting

The result of generating the report is shown in Figure 22.


Figure 22. Result of report generation

Save the changes made

If you change the report structure, you can save it using the command All actions/Save option .

Figure 23. Saving a report option

In the form for saving an option, you can use the switch to select Save to existing report version (instead of one of the already available options), or Save new report version .

For a new option, you must specify a name (by clicking on the button Further ), and then click on the button Save .


Figure 24. Saving a new report version

To select a previously saved report option, you need to run the command All actions/Select option .

Figure 25. Selecting a report option

Thus, by making simple changes, from one standard UT 11 report you can get a whole set of convenient tools for viewing and analyzing a wide variety of information.

Conclusion

As you can see, using the settings of standard UT reports is not so difficult. Of course, there are many more of them than we showed in the example of this article, but the above settings will allow you to get much more benefits from using the new platform and save money on attracting programmers for development.

Of course, not all report settings are similar in structure, but having gained basic knowledge of setting up reports using the examples above, you will be able to set up other reports you need.

8
When you use a dynamic list and a custom query to display data, there are situations when you need to specify the parameter used in this query. Below is an example of displaying information register data in a card... 6
If you, having opened the form of a directory or document, performed some action, the code should change the state of the data in dynamic lists or the value of the attribute. The data has been changed, but in an open form... 4
Found on the Internet but they say it’s from an ITS disk. 3
In 1C, it is assumed that Messages to the User are displayed in order to inform the user about errors. And to inform about the action being performed, it is recommended to use the built-in language method... 2
Often the task arises of showing only the necessary rows in the tabular part of a document or reference book (or other object). There's a great property you can use to do this: in a normal application, the parameter for...

Rating: / 0

Today we will talk about settings in reports in “1C:Enterprise” 8.2 or 8.3, using the example configuration 1C:Enterprise 8. Trade management for Ukraine

Update

We have supplemented the article with settings for configuration on managed forms and wrote about some tricks for setting up reports in 1C:Enterprise 8. Trade management for Ukraine, ed. 3.1 (managed forms)

Let's look at how using an example configuration Trade management for Ukraine

You can easily and quickly customize the report exactly to your requirements.

Managed forms mean that the appearance of reports can be customized to suit you. After all, previously, if a user wanted to change report settings, he had to ask the programmer to “finish” the reports he needed. Now you can customize any report yourself without the help of a programmer.

Report settings in 1C:Enterprise 8. Trade management for Ukraine, ed. 3

To configure the report, click on the button Settings. A window with settings opens in front of us.

To see all (advanced settings), click All actions → All settings

In this window we can add the fields we need, group fields, make selections, and much more.

In the period line – we can choose for which period we want to see data.

Selected fields – here you can add missing fields

On the selection tab we can select only those elements that you need to see.

Types of comparison:

  • Equals– You can only select one value
  • Not equal- value for which you do not want to see data
  • On the list– if you want to select several values
  • In a group from the list- you can select a list of several data groups.
  • Not on the list- selection of a list of positions that should not be included in the report
  • Not in list group– excluding the list of data groups from the selection
  • In Group– in this case you will see data for only one group/category
  • Not in group- data group exclusion

For example, in a list of goods in warehouses, we want to see all the goods that we have in stock. To do this, set the Final balance selection to greater than 0.

Now our report looks like this:

On the sorting tab we can sort our data.

For example, we want to sort our products alphabetically. To do this, go to the sorting window. And simply drag the “Nomenclature” attribute to the right side of the window and set the sorting direction to “Ascending”.

The report started to look like this:

On the Grouping tab we can group data by some value. For example, we want to see our balances in terms of warehouses. Everything is simple here: we click on the three dots, go to the editing groupings window and add a new “Warehouse” grouping and select the “Hierarchy” type.

We will also group by month, that is, we will find out in which month we received the goods.

To do this, add the following grouping: Period month (it is also possible to group by years, quarters, days)

Now let's look at the appearance of our report:

As you can see, in the settings we have doubled the grouping by warehouses. How can we find out where the extra group came from? Since in managed forms you can design a report yourself, so let’s go into the report structure itself. To do this we go to

We see the structure of the report:

That is, the report is structured as follows: first there is grouping by warehouses, then subgroups: grouping by Nomenclature, characteristics, series and units of measurement, after which there is grouping by movement documents, and the last independent grouping is unit of measurement

If we simply disable the Warehouse checkbox, then 2 groups will be disabled: item and registrar. Therefore, we simply “grab” the Nomenclature line and drag it into the Report. Uncheck warehouse. Now the structure of our report should look like this:

Now the report looks nice:

On the item fields tab, we can select only those fields that we want to see in the report. For example, in the List of goods in warehouses report, we want to see the article number of the item, the name of the item, the characteristics of the item, units. measurements. To do this, go to the Item Fields tab and set all the above listed details. Also, in order for the name of the item and its characteristics to be in one column in the report, it is necessary to place these details in one group (as shown in the figure).

Using the Conditional Appearance tab, we can also make our report in color. For example, we want to quickly find the quantity of a product in a certain warehouse. To do this, highlight a specific warehouse with color:

On the Condition tab, select the warehouse that we want to “paint”. Warehouse = Groceries Store

On the design tab, select which color (choose yellow):

On the Formatted fields tab we can see which fields/columns we will change in color. If we leave this tab empty, the program will color in yellow everything related to the “Products Store” warehouse.

Now let’s create our report!

Now it looks like this:

First we see grouping by warehouses, then grouping by month.

You can switch between settings thanks to a button like - Select settings:

Our setting is currently available only to us, but if we want to add it to other users, then we need to go to the section Administration → User and rights settings → Copying settings

On the Report Settings tab we see all the reports whose settings we saved, and now we select our setting.

Now all we have to do is copy and close.

There is one more trick with reports on managed forms: you can add columns and rows in a slightly different way.

Let's go through All actions → Change report variant

The following window opened before us:

Here we can also group, sort, add columns/rows. In general, everything your heart desires.

And using the example of the Gross Profit report, I will show how you can add the Markup column.

We also go to settings via All actions → Change report variant.

In the window that appears, write the name of our column: Markup.

In the Expression of total records field, enter the formula: Revenue/Total*100 – 100

On the left we find a folder called Custom Fields and see the newly created Markup

Add it to the right column

Now let’s add our markup to the report structure: Organization and Divisions:

And let's finish editing.

Let's generate a report.

We see that a new column has appeared, but to put it mildly, we are not satisfied with the number of decimal places. But this is also very easy to fix.

We need to return to the settings, namely to the Custom Fields tab, and edit our formula. The number format we want to see is 2 decimal places.

We make the following formula: Format(Revenue / Total * 100 - 100, “NAV = 2”)

Let's generate the report again.

Now we see that everything is in order!

But it happens that an error pops up: “Division by zero.” To avoid such an error, let's write the formula as follows:

Choice

When Total<> 0

Then Format(Revenue / Total * 100 - 100, “NAV = 2”)

Otherwise 0

End

We can also add a new plate to our report. To do this, we also go to Change report version. Further Add → New Table.

Now let's add rows and columns.

Let's say we want to see gross profit only for the Household Appliances segment.

Let's add the following groupings to the lines: Nomenclature.

On the Selection tab, enable the “Current item has its own selection” checkbox and add items from the household appliances group.

On the Fields tab, also enable the checkbox “The current element has its own settings for the selected fields” - Nomenclature.

In the structure of our table, namely columns, we add a new grouping, leaving the field empty.

Let's call our table: Household Appliances. To do this, go to the Table and on the Additional Settings tab, enter a title (as shown in the figure below).

Now let's generate a report.

Our new sign was included in the gross profit report.

Everything is elementary!

Report settings in 1C:Enterprise 8. Trade management for Ukraine, ed. 2.3

Reports in 1C:Enterprise are a constructor, but not every user knows about the intricacies of report settings.

We set up reporting, click the Save settings button on the report panel, Create a new one, write the name of the report. If you want this report to open when opened, check the Open column.

In order to open the required report setting, click on the Restore Settings button and double-click the desired setting. Don't forget to click the Generate button.

2. How can I customize a more detailed report?

Open the required report, click the Settings button, check the Advanced settings checkbox at the bottom, you will have additional bookmarks.

General tab

Use checkboxes to indicate which columns you need to see in the report and which not.

Use arrows to select the location of the columns.

Groupings Tab

On this tab, you can add/remove those columns/rows that you would like to see in the report, as well as transform the data for easy viewing.

Grouping rows - data will be generated downward, Grouping columns - data will be generated to the side (to the right). For example, in Row Grouping you can view sales data by item, and in Column Grouping you can see these sales by month.

You can add any field to fill in data in the report. Click the Add button, the Select Field window appears, where there are all the options that can be added to the report. We select the required option (with the plus sign you can reveal more information, for example, you need to look at the data in the context of the product article, then you click on the product and everything that relates to the product expands). Click OK to add a new field.


Row/column grouping type is an option for viewing data (grouping), for example Hierarchy, allows you to collapse/expand results.

3. How can I make a selection in a report based on a specific element of a directory/document/group of directories?

Tab Selection allows you to make a selection not only by those rows/columns that are already in the report settings, but also to add your own Selection option.

To do this, click the Add button and add the option you need from the Field Selection window. By ticking we make a choice for which element we will have a selection. Thanks to the Comparison Type column, we can select not only an individual element, but also groups.

Comparison type

Equals- select only one position

Not equal- one position for which you do not want to see data

On the list- the ability to create a list of positions that you want to see in the report. Through the List Selection window, create the required list of directory/document elements.

In a group from the list- you can select a list of individual groups/subgroups. In order to select exactly the group folder, you need to click the Select button, and so make a list of those subgroups for which you would like to see selection.

Not on the list - selecting a list of positions that should not be included in the report

Not in list group- selecting a list of groups/subgroups that should not be included in the report

In Group- you can select only ONE group (to select a group you must click the Select button)

Not in group- selection for one group that should not be included in the report.

4. How to create additional fields in separate columns?

Additional fields tab allows you to create additional fields in a separate column

  • Add the required field
  • Select Placement, in a separate column or in one column that is already in the report
  • Select Position, before the Grouping column (that is, the first column), after the Grouping (second column), or instead of Ggrouping (that is, there will be no Grouping column at all).

5. How to sort a field in a report in ascending/descending order?

For example, we need to display product sales statistics; at the beginning of the report we will have the best-selling product.

Tab Sorting

Select the field that needs to be sorted - this will be the Quantity field (in base units), select the Descending sort option. And first we look at the best-selling product. If you need to look at a poorly selling product, then select sorting by Ascending.

6. How to remove zeros after the decimal point from a quantity in a report

Tab Design

Select the Quantity in basic units area in the column, open the Design column, check the box next to the Format field and open the value.

Next to the Length field, put a checkmark and select the maximum length of your number. If you need to set the fractional separator (that is, how many digits should be after the zeros), then check the box and select the number of decimal places. If you don't need fractional parts, then don't change anything.

We press the OK button, this setting goes to the Edit Design Settings window, we also click OK there, and now this format setting is included in the Design Tab.

We generate a report, and our quantity is now without a fractional part.

* Using the Design tab, you can select different design options. In another lesson we will provide options for setting up the report design.

7. Duplicate report settings for other users.

For example, we have managers who need to save the same Sales report in their settings. There are 7 of these managers, and the report settings are serious, and duplicating this seven times for each user is completely troublesome.

There is a way out!

  • First, let's set up this report for one manager and save it.
  • Then we go to the second manager’s database, open the Sales Report, click on the Restore settings button, this list is empty (since the second manager did not have saved settings).
  • Click on the Settings all users button at the top, and now this list contains all the reports that were saved by users.
  • Select the desired report, click Generate, and we have the report that we configured for the first manager
  • Now we click the Save button and the settings of this report are saved for the second manager.

Today we told you just a few tricks for generating reports in 1C:Enterprise, of course these are not all the secrets, look for the rest in our next lessons.

We hope this lesson was useful to you! Thank you for your attention!

Best regards, company Fin Soft

You can learn this from us in the online courses “1C:Enterprise”, or enroll in our courses “1C:Enterprise”, which take place in our office.

If you have not purchased this program yet, you have an excellent opportunity to buy 1C:Enterprise 8. Trade Management for Ukraine on our website Below we have collected similar topics for you that will help you understand the functionality of the 1C:Enterprise program.

  • < Назад
  • Forward >

Secrets of setting up reports in 1C:Enterprise 8.3 - 4.5 out of 5 based on 6 reviews