How to add an external report to 1s 8.3. Adding an external report to the database

1C 8.3 reports are a special metadata object designed to create a user-friendly presentation of data from 1C database tables.

Let's figure it out how to set up reports, what they are needed for, how external reports differ from built-in ones, and how reports differ from processing.

In order to create or customize a report, you need to know the built-in and . Whatever one may say, the basis for creating almost any report is the initial query that receives the data. We process this data and display it in a user-friendly form.

Reports are the main thing in any information system, so 1C paid close attention to the development of reports and created a large number of designers and mechanisms for creating them.

Let's look at the basic methods for creating reports

How to make a report in 1C using a layout

Creating using a layout is the most routine way. However, they often resort to it out of desperation, because... in this method, the developer completely writes each action in code, which means we can do anything. Other mechanisms cannot boast of this.

But in this case, all the items, menus and other “bows” will have to be entered manually, which is very labor-intensive.

Get 267 video lessons on 1C for free:

Creating a report using the output form designer

The output form designer is a mechanism built into the platform that makes report development easier. The designer is only available for regular forms.

The designer is given the request and all the necessary parameters for the future report, and it, in turn, generates modules and report forms. The mechanism is based on an object of the built-in language 1C 8.2 - Report Builder.

Creating a report using Generic Report

The universal report has great functionality, a convenient settings interface that is familiar to the user:

Reports based on the Data Composition System

This is the most progressive method of creating reports in 1C, recommended by 1C itself. appeared in the 1C platform in version 8.1.

SKD allows you to create simple reports without a line of programming at all, because it has a very flexible and functional constructor for creating a data composition scheme:

In all recent configurations, all reports are written using a data composition system.

What is the difference between external reports and built-in ones?

As it is written in the documentation - nothing. The external reporting mechanism was created in order to debug reports during development.

The only difference when developing a solution is that you cannot access an external report “by name”, unlike a built-in report.

How does a report differ from processing?

In fact, practically nothing. The main difference is the purpose of using the object: reports are needed to display information, and reports are needed to change information.

The main differences in properties: in reports, you can specify the Basic Data Composition Schema (DCS) and specify settings for saving report parameters.

Of course, 1C Accounting 8 has very broad capabilities. With this program you can perform many different tasks. But sometimes the standard built-in tools are still not enough. What to do in this case?

Also be sure to read a similar article that explains what processing is. Here we will talk about expanding the standard functionality of the program.

Let's say you need to perform some operation and you start looking for how to do it in standard 1C Accounting configurations. Depending on What exactly what you want to do, there are several ways to solve the problem.

Method one. Non-standard use of standard program tools. Typically this applies to documents. For example, it is required that the document as a result generate such and such transactions. Then you need to find a document that is similar in meaning and fill it out accordingly, even if at first glance this 1C document is not intended for this at all.

If the document generates transactions loved ones to what you need, but still not quite the same, then you can post the document and then correct the postings manually. I won’t dwell on the peculiarities of non-standard use of ordinary documents here - this is included in my course on 1C Accounting 8. The most important thing is to show a little creativity and knowledge of the configuration, and then it turns out that the range of tasks that can be performed using the standard (unchanged) 1C Enterprise Accounting configuration will expand.

Another way is configuration modifications. For example, one of my students once told me, “ I want to have a button in a visible place in my program “How much money do we have?” ". A completely justified desire, however! ( although in fact such a report already exists in the program)

However, despite the opportunity to modify 1C Accounting at your own discretion, we will not consider this option, since this is a matter for 1C programmers. So what is left for the average user in this case?

There was an important part of the article, but without JavaScript it is not visible!

The answer is very simple - expand the functionality of the program using . In particular, we will talk about external reports and processing.

This is done quite simply. We find the required report (or processing, depending on what is required) on the Internet and connect it to the standard configuration of 1C Accounting 8. For 1C Accounting 8.2, go to the menu "File / Open...", or press the button Open on the toolbar, then in the Explorer window that opens, specify the external report/processing file. An example in the figure below.


"How to connect an external report / processing in version 1C Accounting 8.3?"- the owners of the new version of 1C Enterprise will ask. Almost the same. I remind you once again that the difference is only in the interface. See the example for 1C Accounting 8.3 below.

website_

As can be seen from the examples above, external reports and processing are connected in the same way as regular files are opened in any other program.

After selecting the file, the external report / processing will open and you can use them as if they were built into the 1C Accounting configuration. It is also worth noting that you must have the necessary access rights to the database.

Tip: store the external reports and processing you use in a specially created folder- it's comfortable. The folder can be created in the folder with the 1C Accounting database (if you have a file database); For convenience, you can change the folder icon.

Why are they called "external"?

Because when connected, an external file is opened that has nothing to do with the 1C Accounting configuration. The file itself not built in into the configuration, but only gains access to the database data.

Safety when working with plug-ins

If the reports are only read your base, but they don’t do anything with them, then here’s the processing can. Of course, it all depends on what kind of processing it is and for what purposes it is intended. In any case, we can recommend the following.

Download external processing only from trusted sources! Remember - damage to the database as a result of an error or deliberate actions of the processing author can lead to serious problems.

Application objects designed to obtain all kinds of summary tables, to organize data in a form convenient for analysis and viewing in 1C configurations, are usually called reports. How to add a report in 1C, various options for adding, we will try to cover these and some other questions in this article.

Reports and processing: differences

At the same time, they are distinguished from other similar objects - processing:

  1. Possibility of using DCS (data composition system);
  2. Using processing, you can enter information; the report serves to display and organize data;
  3. The difference is in the file format: the epf extension indicates that we are dealing with processing, erf is typical for external reports.

From a programmer’s point of view, the use of these objects is very convenient, because it does not require changes to the configuration metadata, and, therefore, there is no need to kick users out of the database to update it.

Methods for adding a report to the database

Using a special reference book

In most configurations provided by 1C, there is an “External Processing” directory, which allows you to save the processing in the database without making changes to the metadata. There are two ways to access this directory:

  1. For the Full and Administrative interfaces, go to: Operations->Directories->External Processing;
  2. All others via: Service->Additional reports and processing.
  3. Next, you need to select the type of form you want to receive.

So, how to add a layout to the directory through the form, the form of which is presented in Fig. 1

Fig.1 Report or processing registration form

First of all, it is necessary to come up with an original name for the directory element, which would best reflect the essence of the table being generated. The second step is to select the type of form to be added. It could be:

  1. A printed form called by the Print button or another button in those objects that are indicated in the tabular section “Print Form Accessory”;
  2. Filling out tabular parts for tabular parts of documents and reference books presented in the Tabular part “Processing accessory for filling out tabular parts”;
  3. Treatment;
  4. Report.

Rice. 2 Report type selection field

At the final stage, you need to select the file containing the code to be processed from those saved on disk.

Fig.3 Inscription indicating the need to select a report file

By recording an element, you will save it in the database. When restoring and transferring the database, elements saved in this way will also be transferred.

Adding to Configuration

The steps below require exclusive access to the database.

By going to the configurator and opening the configuration, you can start adding processing.

If the configuration is closed for editing, you need to go to the menu item Configuration->Support->Support Settings. A window will open as in Fig. 4

Rice. 4 Support editing window

  1. Click the “Enable change option” button;
  2. Answer the system's question positively.

This way, you will be able to add your own elements to the database metadata.

Now, by right-clicking on the “Reports” line of the configuration tree, you can add an external data compositor to the configuration in Fig. 5.

Rice. 5 Submenu for adding a report to the configuration

Features of placing processing on managed forms

The interface, built on managed forms, imposes its own restrictions on the display of additional handlers added to the database.

Before adding a report to a managed form in 1C, you need to make sure that it was created using an access control system, otherwise the form will be displayed incorrectly.

Having opened the program in Administration mode, you need to find the item “Print forms, reports and processing” in the Navigation Panel

Rice. 6 Navigation panel 1C 8.3

By checking the “Additional reports and processing” checkbox in the window that opens, you will be able to add your developments for the managed form to the database.

On the form, click the “Create” button. After ignoring the warning window, you can proceed to select the file.

Very often in the latest versions of the program, the addition crashes with an error stating: “Object method not found.” The fact is that after creating a handler using the data composition system, it is necessary to register in its module the function InformationOnExternalProcessing() marked Export, this function should return the registration parameters:

  1. The object to which the handler will connect;
  2. The name with which it will be registered in the database;
  3. Team name.

After this, you can start placing the report in the interface. To do this, click on the “Place” command.

Rice. 7 Accommodation

In this case, the activity of the element is regulated by selecting the appropriate value in the “Publish” field.

Adding without posting

Rewriting a directory element every time any changes are made to the code, especially registering this handler in the configuration, is quite a tedious task. You can do without this. It is enough to simply open the file containing the processing through the File->Open File menu. The most recently opened objects are stored in a list at the bottom of the File submenu.

Regulated reports

In addition to external files and processors provided by the configuration, there is another type of reports in 1C - regulated. These are the data arrangements whose work is regulated by the tax authorities.

By the nature of their work, these forms are more reminiscent of a document. The validity period of such processors rarely exceeds one quarter; 1C regularly releases updates to them.

You can open them from the Reports->Regulated reports menu. After selecting a report option, the program will fill it with data from the database. If there is not enough data, the program will offer to add the missing data manually.

Forms that are not completely filled out are saved with the possibility of additional filling. A fully completed and verified document can be printed on paper or submitted to the tax office electronically.

In the top menu go to Service->->.

After this, the directory list form will appear. In the top menu click Add.

The window for adding a new report appears. Press the button Open.

Select the file with the desired report and click Open. After adding the file, if necessary, change the name of the report (how it will be displayed in the list). Click OK.

As a result, the new report appears in the list.

After this, the report can be used, adding is completed. To open this report later, we also go to Service->Additional reports and processing->Additional external reports.

For BP 3.0, ZUP 3.0, UT 11, ERP 2.0.

To add an external report in 1C:Enterprise 8.3 configurations in a managed interface (using Accounting 3.0 as an example), let’s enter the corresponding section of the program:


It is necessary that the option to use additional reports is enabled, follow the hyperlink:

In the list that opens, click the button Create:


After this, a file selection dialog box with a report will immediately open, in which you need to select the desired file (in my case, it is a file with a plan-actual cost analysis).

Now you need to configure accommodation(the place in the program where the report will be available):


Randomly select the desired section of the program from the list:


Now you need to record the changes in the external report card:

Now open the report from the program interface:


The list is still empty, click Customize the list:


In the selection form, tick our report:


Now it appears in the list:


By button Execute The report form opens:


They say that the name 1C originally meant the phrase “one second”, i.e. programs must produce reports quickly, “in one second.” The speed of the reports is very important, but it is even more important that the reports provide the correct information - we will understand this using the example of creating a simple report in 1C 8.3 based on the Trade Management 10.3 configuration. To create correct reports, it is desirable (even strongly recommended) to be able to configure 1C and to be able to program a little in the internal language and query language of 1C, although, on the other hand, creating reports is an excellent opportunity to start mastering these skills.

This description is educational for understanding the basic principles of creating 1C reports

How to create a report in 1C 8.3

To create a report, you need to open 1C in configurator mode; to do this, in the 1C launch window, select the desired database in the list and click the Configurator button:

In the configurator itself, go to the File menu and select New:


In the menu that appears, select External report and click OK:


After this, a new report window will open. In the Name field, enter the name of the report; it must be without spaces or special characters:


How to make a report using a layout

This method most requires programming skills in 1C, but here we will not analyze the mechanisms for receiving and processing data, we will make a simple report to understand the mechanism for launching the report and displaying the report form on the screen:

In the report window (which opens when creating a report), in the lower list, place the cursor on the Layouts item and, when you right-click, click Add in the menu that appears:


In the layout designer that opens, you can specify the name of the layout, Spreadsheet Document should be selected as the layout type, and then click the Finish button in the designer:


This will open a layout window resembling an Excel sheet:


In this layout, you need to create areas - groups of rows or columns that the program will use as templates, insert data received from the database into them and display these templates on the screen, thereby putting together a report from these parts.

Let's create a report that displays a list of items. To do this, we will create two layout areas: the report header and the item line.

To create a header area, left-click on the line header (where the line number is indicated) to select the line like this (the entire line should be selected with one click on the header):


After that, go to the Table menu of the main menu, go to the Names submenu and click on the Assign name item:


The program will prompt you to specify the Area Name, the name should also not contain spaces or special characters, after that click OK, it should look like this:


Now in the created area you need to enter the text that will be displayed in the report and format it. To do this, enter text in the first cell, for example, “List of items.” Working with cells is similar to Excel.

To format text in a cell, right-click on the cell and click on Properties. The cell properties window will open on the right. Scrolling down the contents of the window, find the Font field and click on the “...” button:


In the window that opens, in the Style section, check the Bold box and click OK:


The layout should look like this:


In the same way, we create the item line area, but do not highlight it in bold:


In the line area you need to indicate that Name is a parameter, i.e. that the real name of the item will be substituted there when outputting the report. To do this, open the properties of the cell with the name and in the properties in the Filling field, select the value Option, this completes the layout setup:


We return to the main report window and in the lower list, right-click on the Forms item and click Add:


In the report form designer that opens, click the Finish button, the report form will open, double-click on the Generate button:


As a result, the button properties window will open on the right side of the screen; in the Action field, click on the magnifying glass:


After this, a form module will open in which you need to program the generation of a report:


First, replace the selected text with the following program code:

//create a spreadsheet document that will be filled with parts of the report and displayed on the screen
TabDocument = New TabularDocument;
//next, we get the layout that was created when creating the report
Layout = GetLayout("Layout");
//now we need to display the report header, for this we get the header area from the layout and display it in a spreadsheet document
AreaHeader = Layout.GetArea("Header");
TabDocument.Output(AreaHeader);
//using a query we get a selection of item names that need to be displayed in the report
Request = New Request;
Request.Text = "
|SELECT
| Name
|FROM
| Directory.Nomenclature
|";
//get the item line area from the layout - we will access it in a loop to display each item
AreaString = Layout.GetArea("String");
//process each name from the resulting selection in a loop
Select = Query.Run().Select();
While Select.Next() Loop
//to display the next line, you need to specify the next name in the area parameter (we configured the parameter itself when creating the layout)
AreaString.Parameters.Name = Selection.Name;
//the parameter has been filled in, now you can display the string
TabDocument.Output(AreaString);
EndCycle;
//the spreadsheet document has been created, now we display it on the screen
TabDocument.Show("List of items");

When the text is copied into the form module, lines starting with a double slash “//” will be highlighted in green - these are comments that describe what each line of code does:


Let's summarize what lines of program code are needed to generate a report:

  1. It is necessary to create a spreadsheet document that will be filled with parts of the report and displayed on the screen; this is done with the line “TabDocument = New TabularDocument;”
  2. We need to get the report layout, from it we will get the report structure in parts (areas), this is done with the line “Layout = GetLayout(“Layout”)”
  3. To display each of the areas, you need to get it from the layout and output it to a spreadsheet document, this is done with the lines "Header Area = Layout.GetArea("Header")" and "TabDocument.Output(HeaderArea)"
  4. If you need to fill in parameters that become known only when the program is executed, then before displaying the area you need to fill in such parameters, this is done with the line “AreaString.Parameters.Name = Selection.Name”
  5. And only when the spreadsheet document is filled with all the necessary parts of the report, it is displayed on the screen, this is done with the line “TabDocument.Show(“List of items”)”

And now you can check the operation of the report - open 1C in enterprise mode (button 1C: Enterprise in the 1C launch window). In the main menu, go to the file menu, click Open:


Find and open the saved report file. In the form that opens, click the Generate button:


and we get a list of nomenclature:


This is just one way to create reports in 1C. In the following articles we will look at others.

mob_info