Where are printables stored?

Consider writing a simple printable in 1s 8.1 - 8.2 on the configuration example Enterprise Accounting 2.0. Suppose you want to write an external printable to the document: display the main data of the document, as well as from the tabular part Products: nomenclature, price, quantity and amount.

You can download the resulting example by .

In the configurator 1C Enterprises 8 create external processing ( File->New->External Processing), set a name, create an attribute required for the external printing form ReferenceToObject with type DocumentReference.Realization of GoodsServices.

Create a printable layout

Adding a new layout, leave the layout type spreadsheet document. We create three areas on the layout: Header, Data and Basement. You can do this by selecting the desired number of lines and clicking the menu Table->Names->Assign Name (Ctrl+Shift+N).

After that, we begin to place text and parameters in the areas. Let's put it in the header printable name, document number and organization, as well as draw the borders of the table header and write the names of the columns. When creating a parameter in the cell properties, on the Layout tab, set the property filling into meaning Parameter.

In the area of Data create parameters for outputting the rows of the tabular section( Nomenclature, price etc.), but in the area Basement for totals by quantity and amount.

Programming

Let's go to the printable object module Actions->Open object module.

Let's create an export function that is obligatory for printing forms Seal().

Function Print () Export EndFunctions

Let's create a variable in the function spreadsheet document, in which the printed form will be displayed, we get layout and layout area.

TabDoc = new SpreadsheetDocument; Layout = GetLayout("Layout" ); Header Area = Layout.GetArea("Header" ); ScopeData = Layout.GetScope("Data" ); AreaFooter = Layout.GetArea("Basement" );

Fill in the parameters hats and take it to spreadsheet document.

Header Area.Parameters.HeaderText = +ObjectReference.Number; HeaderScope.Parameters.Organization = LinkToObject.Organization; TabDoc.Output(HeaderArea);

To get table rows Products use query.

Request = new request; Query.SetParameter("Reference", ObjectReference); Query.Text = "SELECT | Realization of Goods, Services, Goods.Nomenclature, | Realization of Goods, Services, Goods. Amount, | Realization of Goods, Services, Goods. Price, | Sales of Goods, Services, Goods. Quantity| FROM | Document.Sale of GoodsServices.Goods AS Realization of GoodsServicesGoods|WHERE | ImplementationProductsServicesProducts.Reference = &Reference";

We pass the props to the request parameter ReferenceToObject to specify in the condition WHERE that we need data only from the document from which we display the printed form. To get a selection of a query, we first execute it and then select the rows.

Selection = Query.Execute().Select();

Next, in the loop, fill in the parameters of the area Data for each line of the document selection and display them in spreadsheet document. Also in the loop we count the total values quantity and amounts. We will not fill in each parameter separately, but we will use the procedure FillPropertyValues((<Приемник>, <Источник>) from global context, it copies the property values <Источника> to properties <Приемника> . Matching is done by property names. You can read more about this in syntax assistant 1C Enterprise 8.

TotalSum = 0 ; TotalNumber = 0 ; While Selection.Next() Loop FillPropertyValues(DataArea.Parameters, Selection); TotalSum = TotalSum + Sample.Sum; TotalQuantity = TotalQuantity + Sample.Quantity; TabDoc.Output(DataArea); EndCycle ;

Fill and display the area Basement.

AreaBasement.Parameters.TotalQuantity = TotalQuantity; RegionBasement.Parameters.TotalAmount = TotalAmount; TabDoc.Output(RegionFooter);

We return the filled spreadsheet document from the function Seal().

return TabDoc;

If you use one of the typical configurations, then after returning the spreadsheet document 1C will automatically display the printed form. You can also use the spreadsheet method for output. Show().

5. Connecting the printable to the document

AT typical configurations 1C 8 there is a directory for registering external printing forms ExternalProcessing. To connect, go to the menu in enterprise mode Service->Additional reports and processing->Additional external printing forms.

We add a new element of the directory, load the printed form from the disk and select the type of document.

Now in document Sale of goods and services a new printable will appear.

Print form auto-registration

In order to avoid the need to select the type of document manually when connecting the printable, you can configure auto-registration. To do this, we add a new layout and call it Parameters_Autoregistration(only so) and in its first cell we write The documents.<Наименование документа> (or Reference books.<Наименование справочника> ).

Now, when connecting the print form, we will be prompted to use auto-registration options.

This article will describe in detail how a beginner who does not know 1C 8 well to create a printable. For example, let's take one of the most common 1C 8 configurations - Accounting 2.0. Creating a printable 1C stages of writing:

  • Creating an external printable file;
  • Creation of a printed form layout;
  • Writing a program code for displaying printed form data on the screen;
  • Creation of parameters for auto-registration of a printed form;
  • Connecting an external printing form to the base 1C Enterprises.

Creation of a printed form 1C. Formulation of the problem

We are required in the configuration Accounting 2.0 create a printable for a document Receipt of goods and services. In the header of the printed form, display the following data:

  • Organization;
  • Counterparty;
  • counterparty agreement;
  • Date of receipt.

Display table data in tabular form Products document. The table should include the following columns:

  • Nomenclature;
  • Quantity;
  • Price;
  • Sum;
  • As well as the price of the item for the current date (by type of prices from the document).

External processing file

Let's move on to solving the problem. To get started, open 1C 8 in mode Configurator. It is in this mode that all developments are carried out on the 1C 8 platform. Now we need to create an external processing file. To do this, click on the menu File -> New... or by the icon of the new file.

In the window that opens, select the item External processing.

Further into the field Name you must enter the name of the external processing. In our case, let's call it simply: "Printing Form", the synonym field will be filled in automatically. Please note that in the field Name, external processing, the name should be written without spaces and punctuation marks.

Add an external processing attribute ObjectReference and select for him type DocumentReference.Receipt of GoodsServices. To do this, in the metadata tree of external processing 1C, select the item Requisites and press the button Add(green plus button). In the right part of the screen, the attribute properties window will open, in the field Name write - LinkToObject. AT field Type of press the button with three dots.

Expand the branch in the type tree DocumentLink, and find the item Receipt of Goods and Services there, check the box next to it and click OK.

Let's save the external processing file to the hard drive, for this we will use the menu File -> Save, icon Save(blue floppy disk) or a keyboard shortcut ctrl+s. Let's name the saved file "PrintForm".

Create a printable layout

Let's start creating a 1C printable layout. The layout serves as a template for the output of the printable, so if you want your printable to look good, you should pay attention to it.

Let's add a new layout in the external processing metadata tree, we won't change anything in the layout designer window and press the button Ready.

In the new layout that opens, let's create several areas needed to display the printed form. All the layout areas we need will be horizontal, so to create a new area, select the required number of layout lines and go to the menu Table -> Names -> Assign Name or use keyboard shortcut Ctrl+Shift+N then enter the name of the region in the box. When creating a layout area, do not be afraid to make a mistake with the number of lines; you can always add or remove them. To delete a 1C layout row, select the desired row and select the item in the context menu Delete. To add a new line to the layout, select any line of the layout and select the item in the context menu push apart.

Adding a Layout Header

Let's create an area first. Hat, it will display the data for the header of the printed form. For this area, we need seven layout lines. Select them and, as I wrote above, press the keyboard shortcut Ctrl+Shift+N, in field Name write "Hat" and press the button OK.

Let's fill the layout area with the data we need. Usually, no printed form is complete without a header, so we will create it in our layout header as well. Since in the header, in addition to the name of the printed form, we will also display the number of the document from which it was printed, we will set the text of the header in the layout as a parameter. A layout parameter is a specially designated layout cell into which various data can be displayed using the built-in 1C 8 language. The title should be displayed on the entire width of the printed form, so let's decide how many layout cells will be enough for us to print on the standard landscape orientation of the sheet.

Usually thirteen or fourteen layout cells are enough, select them in the first line of the area Hat and merge into one cell ( Context Menu -> Merge). After that, double-click on the resulting large cell and write the name of the parameter, in our case "HeaderText". In order for the entered text to become a full-fledged parameter, right-click on the cell and select the item in the context menu Properties. Bookmark Layout find a field filling and choose the value Parameter. The parameters in the 1C layout are indicated by brackets "<>».

The title of the printed form should stand out among other text, so once again select the cell and use the icons on the layout formatting panel to set the text alignment Centered and font size 14.

After the title text, we will display in the area Hat data on the organization, counterparty, counterparty agreement and the date of receipt of the goods. Since all this data is also taken from the document, we will also decorate them with parameters. In addition, before each parameter, you should write an explanatory text so that the user can easily understand where the organization is, and where the counterparty is, etc. All these actions are similar to creating a header, so I will not dwell on them in detail, I will only give a picture with what should turn out in the end.

The figure shows how the layout options differ from plain text.

Adding a Layout Table Header

The last thing we need to create in this layout area is the table header, in which the data of the tabular part will be displayed. Products. The columns required for the table were described in the "Problem Statement" section. We will also create a table header using the merging of cells and writing text (column names). Select the borders of the table header using the tool Frame, which is located in the layout formatting bar.

Adding a table to a layout

Let's create another area in the layout - Data. It will display the data table of the tabular part Products. We only need one layout line for this area. To display all the lines of the tabular part in a printed form, we will fill in and display this area the required number of times. Speakers in the area Data must match the columns of the table header, so filling it out will not be difficult. The only difference is in the area Data we need options, not just text. Also note that by default numeric parameters are formatted on the right margin and text parameters on the left. To select columns, you also need to use the tool Frame.

Adding a Footer to a Layout

The last area of ​​the layout we need is Basement. It will display totals by quantity and amount. Creation is similar to creation of an area Data, but in addition, the results should be highlighted in bold.

The result should be a layout that looks like this:

Creation of a printed form 1C. Programming

Let's start programming - this is the most important stage in creating a printed form. First of all, let's go to the module of the external printing plate object, this is where we will program. To do this, in the main window of external processing, press Actions -> Open object module.

In the external printing form object module, you need to create an export function Seal().

Function Print() Export EndFunction

Please note that this feature is required for external printables in configurations using a regular application. We will write all subsequent program code necessary to display the printed form inside this function.

Initializing Basic Variables

Let's create a variable TabDoc, which will contain a spreadsheet document - it is he who is the printed form into which we will display the filled areas of the layout.

TabDoc = new SpreadsheetDocument;

into a variable Layout we will receive the printed form layout created by us. To do this, we use the built-in function GetLayout(<ИмяМакета>).

Layout = GetLayout("Layout");

We will get all areas of the layout into variables. To do this, we use the layout method GetRegion(<ИмяОбласти>) .

Header Area = Layout. GetArea("Header"); AreaData = Layout.GetArea("Data"); AreaFooter = Layout.GetArea("Basement");

Displaying the printable header in a spreadsheet document

All necessary variables are initialized. Let's start filling and displaying layout areas in a spreadsheet document. First of all, let's fill in the title of the printed form, for this we need to pass in the parameter Title Text, which we created in the layout, the text we need. To fill in the parameter values, the layout area has a special collection, which is called - Options. From which through the "." you can get any parameter. In the title text we will pass the text: “Printing form”, as well as the document number.

Header Area.Parameters.HeaderText = "Printing Form"+ReferenceToObject.Number;

The remaining parameters of the header will be filled in a similar way, all the values ​​​​required for them will be obtained from the props ReferenceToObject, which contains a link to the document to be printed.

HeaderScope.Parameters.Organization = LinkToObject.Organization; Header area.Parameters.Account = LinkToObject.Account; Header Area.Parameters.IncomingDate = ObjectReference.Date; Header Area.Parameters.Counterparty Agreement = LinkToObject.Counterparty Agreement;

All header parameters are filled in, we will display it in the spreadsheet document we created, for this we use the method output(<Область>) .

TabDoc.Output(HeaderArea);

Writing a request for a printed handicap

Let's start filling and displaying the area Data. Creating a 1C printable also implies writing a query, we need it to get the data of the tabular part Products and prices Nomenclatures for the current date we will use Request. The 1C 8 query language is similar to SQL, or rather, practically copies the capabilities of its SELECT statement, but the entire query is written in Russian. Therefore, if you are at least remotely familiar with SQL, then you will easily understand the 1C 8 query language.

In this printed form, the request will be quite simple and many will say that one could do without it, but knowledge of the query language and the ability to use it correctly is one of the main skills of a 1C programmer. Queries allow using fewer resources to obtain the most complex data selections, and it is also much easier to understand the text of the query than in the program code written without using the query (or with minimal use of it). In addition, 1C 8 has a very good query builder that allows you to interactively collect a query from the necessary tables.

Let's create a variable that will contain the request.

Request = New Request;

The text of the request will be composed using the query builder. Let's start by writing:

Request.Text = "";

Put the mouse cursor between the quotes, press the right mouse button. In the context menu that opens, select the item Request constructor, it will help us a lot in creating a 1C printable. After that, the query designer window will open, it contains many tabs, but our query will need only four: "Tables and Fields", "Relations", "Conditions", "Joins / Aliases".

For our query, we need two tables: the tabular part Products document Receipt of goods and services and a slice of the latest information on the current date of the register Item prices.

In the left part of the designer window, find the column Database. It contains a tree of all metadata objects, let's find the ones we need. To do this, open the branch The documents and find the document Incoming Goods Services, expand it and find the tabular part Products, drag it to the column of the query designer tables. There are three ways to drag and drop: by dragging, by double-clicking on the table, or by selecting it and clicking the ">" button. Let's open a branch RegistersInformation and find a table there PricesItems.SliceLast, also drag it to the column tables. These two tables are enough for our query.

Let's select the fields we need from the resulting tables. To do this, in the column tables open the table and find the fields: Nomenclature, Amount, Price, Quantity and drag them to the third column of the constructor - fields. Let's open the table , find the field Price and also drag it to fields.

The structure of the tables and fields of our request is ready, now let's deal with the conditions. We need the data of the tabular part Products were not taken from all receipts, but only from the one that we print. To do this, we impose a condition on the table Incoming Goods Services Goods. Let's go to the "Conditions" tab of the query builder. In a collumn fields the tables we selected earlier are located, for the condition we need the field Link from the table Receipt of Goods, Services, Goods, drag it to the Conditions window.

In 1C queries, you can use parameters, they are needed in order to transfer data to the query. For example, if we want to limit the selection of documents to a specific document, then we can use a parameter to pass a link to this document to the request and use this parameter in the condition. This is exactly what we will do in our request.

Once out the window Terms we added a field Link, the query builder will create a parameter with the same name and place it after the "=" sign. This parameter can be renamed if desired. In the text of the request, the parameters are marked with the “&” sign, but in this case this is not necessary, since it is assumed that the parameter is in the second part of the condition, you just need to remember it. How to pass a value to a 1C request parameter will be discussed below.

Since in the query we use not the full price table of the item, but a virtual one (a slice of the latter in this case), we need to set the conditions for the formation of this virtual table, in our case this is the date of the cut and the condition for the type of prices (prices must be selected that have a strictly defined price type - the one that is specified in the receipt document that we print).

To fill in the parameters of the virtual table, go to the tab Tables and fields query constructor, in the column tables select a table PricesItemsSliceLatest and press the button Virtual Table Options located at the top. In the window that opens, in the field Period you should set the parameter to which the date for which the price cut will be made will be passed. In our case, this will be the current date (that is, today), so we will name the parameter "&CurrentDate". In the condition field, we will write the conditions for the price type, we will also pass it in the parameter, which we will call “&PriceType”. The resulting condition will look like this (where Price Type- register measurement Item prices):

PriceType = &PriceType

The parameters of the virtual table are filled, click the button OK.

Now that we have limited the selection to only the document we need, let's create relationships between the query tables. If this is not done, then the prices from the table PricesItemsSliceLast will not be associated with the item from the receipt. Let's go to the tab Connections query builder. Let's create a link by field Nomenclature between our two tables. To do this, press the button Add, in field Table 1 choose a table Incoming Goods Services Goods, and in the field Table 2 - PricesItemsSliceLast. In the connection conditions, select the fields Nomenclature from both tables.

It should also be noted that in the query selection we need to get all the rows from the tab-part Products and prices only if they are available for the current date by document price type. Thus, these tabparts Products are mandatory, but price cutoff data is not. Therefore, in the links between these tables, it is necessary to use the so-called LEFT JOIN, and the left (or mandatory) table will be Incoming Goods Services Goods, and the right (or optional) PriceItemSliceLast. In order for the left join of the query tables to work as I described above, you need to check the box All after the field Table 1.


The request is almost ready, it remains only to work a little on the field aliases. Go to bookmark Unions / Aliases and set an alias for the field PricesItemsSliceLast.Price. The alias name will be − PriceForToday, it is needed so that the names of the query selection fields and the names of the parameters in the layout of the printed form match.

The work in the query designer is over, let's press the OK button. After the constructor window closes, you will see that the line with the request text is filled in and looks like this:

Request. Text = "Choose | receipt of services. Nomenclators, | receipt of services. Summary goods, | receipt of services. Crouping goods. Products, | Investigation services. Complexities, | prices of the prisoners of the next day. (| &CurrentDate, PriceType = &PriceType) AS PricesItemsSliceLast | By Incoming GoodsServicesGoods.Nomenclature | = PricesItemsSliceLast.Nomenclature |WHERE | Incoming GoodsServicesGoods.Reference = &Reference";

Execution of a request

We will pass the necessary parameters to the request, for this we will use the request method setParameter(<ИмяПараметра>,<Значение>). To get the current date, use the built-in function The current date(), it returns the date and time of the computer.

Let's execute a query to get a selection with the data we need. To do this, we first use the query method Execute(), and then the method Choose().

Selection = Query.Execute().Select();

Filling out the printable table

As a result, in the variable Sample will contain a selection of query results, you can navigate through it using the method Next(), and to bypass the whole one will need a loop Bye. The structure will look like this:

While Selection.Next() Loop EndCycle;

It is in this cycle that we will fill and display the layout area Data. But first, let's initialize two variables of a numeric type. In them we will collect the totals by the number and amount that we need to display in the area Basement.

TotalSum = 0; TotalNumber = 0;

Inside the loop, we will fill the area Data data from the current selection element into variables TotalSum and TotalNumber add sum and quantity values, and finally, display the area in a spreadsheet document using the method already familiar to us output(). Since the field names of our request are exactly the same as the field parameter names Data, then for filling we will use the built-in procedure FillPropertyValues(<Приемник>, <Источник>) that copies the property values<Источника>to properties<Приемника>.

While Selection.Next() Loop FillPropertyValues(DataArea.Parameters, Selection); TotalSum = TotalSum + Sample.Sum; TotalQuantity = TotalQuantity + Sample.Quantity; TabDoc.Output(DataArea); EndCycle;

Output of the footer of the printing form into a spreadsheet document

It remains to fill and display the last area of ​​the layout - Basement. We have already prepared the data for filling, filling and output are carried out according to the same scheme.

AreaBasement.Parameters.TotalQuantity = TotalQuantity; RegionBasement.Parameters.TotalAmount = TotalAmount; TabDoc.Output(RegionFooter);

The spreadsheet document is completely filled out, it remains to display it on the screen so that the user can view the printed form and, if necessary, print it. But in typical 1C 8 configurations, the procedures of special modules are responsible for the output of external printing forms. Therefore, it is enough to return from the function Seal() completed spreadsheet.

Return TabDoc;

At this stage, the programming is completed and the creation of the printable form 1c is almost complete. Full text of the function Seal() I won’t give it here, you can see it in a printable file, which you can download at the bottom of the article.

Creation of a printed form 1C. Auto-registration options

When connecting an external printable to the database, the system does not automatically determine for which particular document or directory the printable is intended, you have to select it manually. And if another person wrote the printed form, and you are only instructed to connect it, then the choice can become ambiguous. In order to avoid such problems, in all external printables it is necessary to create a layout with auto-registration parameters. If it is created and correctly formatted, the system automatically determines which document or directory the printed form is intended for.

It is done as follows:

  • In external processing, we create a new layout. We call it “Parameters_Autoregistration” (important not to be mistaken!).
  • In the first cell of the layout we write The documents.(or Reference books.) and the name of the document to which you want to connect the printable.

Connecting to the base of an external printing form

  • Run 1C 8 in mode Company;
  • Go to menu Service -> Additional reports and processing -> Additional external printing forms;
  • Click the button Add;
  • In the window that opens, click the icon Replace external processing file;
  • If you have created auto-registration parameters, then we agree to use them;
  • If you have not created auto-registration parameters, then in the tabular section Accessory of the printing plate add the required document or directory;
  • We press the button OK.

After that, the external printable will be available in the menu Seal document Delivery of goods and services. The creation of a 1C printable on this can be considered complete.

It's no secret that, although in our time an increasing number of companies are switching to electronic document management, the old saying "Without a piece of paper you ..." does not lose its relevance. It so happened that for some reason the inspection bodies are primarily interested in paper documents. Therefore, if you actively use the 1C: Accounting or Enterprise program for financial control, it is important to know how to print an electronic document created using the program.

Printable forms in 1C allow you to transform an electronic document into a printed version.

To do this, the developer has provided an excellent tool - Print Constructor. With it, you can create documents in which you can specify any data you need, and not just a few standard forms. This is especially true for those documents that do not have a strictly regulated form, which in no case can be changed. This, in particular, includes an act of work performed, some invoices or payments.

In this guide, we propose to understand the capabilities of the Print Designer, consider what types of printing forms can be and how they differ from each other. We will also show with an example how to print the created form.

To begin with, it’s worth figuring out what, in general, is a printable form in 1C 8. This is a 1C spreadsheet template (like Excel), in which some variable lines are indicated that are filled in with data from the program when drawing up a document.

There are two types of printables:

  • Internal (built-in). They are stored in the program configuration, so it's better not to change them, as problems may arise during the update later.
  • External - stored separately from the program settings. And with their help, you can create and prepare for printing a document of almost any complexity without affecting the configuration of the 1C 8 program.

How to choose already prepared layouts? After you carry out an income or expense operation, for example, write out an act of completion, you click the "Print" button to print the documents. The list displays a list of forms for printing, which are already filled in with the entered data about the transaction and your company. By clicking on the type of document you need, you open a preview window so that you can make sure that the data filled in is correct. The print button outputs the document to the printer.

With the basics out of the way, let's figure out where all your printables are stored. Let's move on to the next question.

Where are printables stored?

You can view the built-in printables both in the configurator mode and in the normal enterprise mode. In the first case, you need to press the corresponding button in the start window when starting the program. You will see the program menu, find the “Realization of Goods and Services” branch, which contains the “Layouts” item. It often contains only two items - "Invoice" and "Act". Where, then, is everyone else, because the list is much more extensive? They are just hiding somewhere else. You need to open the “General” - “General Layouts” branch, almost all layouts are stored in it.

In the second case, you need to go to the menu section "Administration" - "Print forms, reports and processing" - "Print forms layouts". It will display all document layouts. It is noteworthy that in the same menu they can be edited.

As for external forms, they must first either be created through the configurator mode, or by downloading a ready-made file, and then connected in the "Administration" - "Printed forms, reports and processing" - "Additional reports and processing" menu. We will talk about this a little later.

Creating a simple form through the built-in Print Constructor

Such a printable does not imply the possibility of deep editing, since this will entail a change in the configuration of the program, as well as further difficulties when updating it. However, if you are completely satisfied with the standard form, or if you want to delve into the intricacies of creating an external form, this method is completely suitable for you.

  1. First of all, start in the Configurator mode, find the document you need, for example, Realization of Goods and Services, in the document properties, go to Actions - Constructors - Print Designer.
  2. When prompted for a job option, select Common Forms.
  3. Give the new layout a name, such as "Invoice Print".
  4. Select the details that you would like to see in the header of the document. Moreover, they must be selected in the order in which they will be displayed. To select, you need to highlight the item in the left column with the cursor and press the arrow in the middle of the screen so that the attribute is displayed in the right column.
  5. Mark the details to be displayed in the tabular section. The choice of details follows the same principle as in the previous paragraph.
  6. In the same way, select the details of the bottom of the document.
  7. At the final stage of creation, choose whether you want to print immediately without previewing, whether you need table protection, and then confirm the creation of the form with the OK button.

Creating an External Printable

Forms created through the Print Designer can be compared to a visual program editor, when you do not enter all the code manually, but only compose it from the proposed elements. The external form is a file with manually written program code, which describes the procedure for displaying data on the screen. This is what allows you to edit the printed form, as you like, specifying absolutely any data in any sequence.

An additional advantage is that, even if you do not understand or simply do not want to understand the intricacies of 1C 8 programming, you can entrust this procedure to professionals. They will be able to prepare the necessary form for you, provide it to you in the form of a ready-made file, which you only activate with a few clicks of a button.

Now more about the procedure itself. Consider the example of creating an "Account" layout for the document "Implementation (acts, invoices)".

  1. Open the 1C 8 program in the Configurator mode.
  2. Click File - New - External Processing, give it a name (it shouldn't include spaces), then click Actions - Open Object Module.
  3. In the input field that opens, enter the following code (values ​​that can be changed to your own are highlighted in yellow):

Function DetailOnExternalProcessing() Export
RegistrationParameters = New Struct;
AssignmentArray = New Array;
Array of Assignments. Add("Document. Realization of Goods of Services"); //Specify the document to which we make an external print. form
RegistrationParameters.Insert("View", "PrintForm"); //may be - PrintingForm, Filling in an Object, Additional Report, Creating Related Objects ...
RegistrationParameters.Insert("Assignment", Assignment Array);
Registration Parameters.Insert("Name", "Order for the sale of goods"); //name under which the processing will be registered in the directory of external processing
RegistrationParameters.Insert("SafeMode", FALSE);
RegistrationParameters.Insert("Version", "1.0");
RegistrationParameters.Insert("Information", "This printable form was created as a sample");
CommandTable = GetCommandTable();
AddCommand(CommandTable, "External Order", "External Order", "ServerMethod Call", True, "PrintMXL");
RegistrationParameters.Insert("Commands", CommandTable);
Return ParametersRegistration;
EndFunction // ExternalProcessing Details()
GetCommandTable() function
Commands = New ValueTable;
Commands.Columns.Add("View", New TypeDescription("String"));//how the description of the printable form will look like for the user
Commands.Columns.Add("Identifier", NewTypeDescription("String")); //print form layout name
Commands.Columns.Add("Usage", NewTypeDescription("String")); //Call ServerMethod
Commands.Columns.Add("ShowAlert", NewTypeDescription("Boolean"));
Commands.Columns.Add("Modifier", NewTypeDescription("String"));
Team return;
EndFunctions
Procedure AddCommand(CommandTable, View, Identifier, Usage, ShowAlert = False, Modifier = "")
NewCommand = CommandTable.Add();
NewCommand.View = View;
NewCommand.Identifier = Identifier;
NewCommand.Use = Use;
NewCommand.ShowAlert = ShowAlert;
NewCommand.Modifier = Modifier;
EndProcedure

  1. Save the layout for printing as a file to any folder on your hard drive, name it accordingly.

Insert the procedure for starting printing from the program menu into the same document (the commands highlighted in yellow must match the line):

AddCommand(CommandTable, "External Order", "External Order"):
Procedure Print(Array of Objects, Collection of Print Forms, Print Objects, Output Parameters) Export
PrintManagement.OutputSpreadsheetDocumentToCollection(
CollectionPrinted Forms,
"External Order"
"External Order"
GeneratePrintForm(ArrayObjects,PrintObjects);
EndProcedure // Print()

  1. Insert the layout of the printed form filling by clicking on the name of the external form in the lower left corner and selecting "Layouts" - "Add" - "Spreadsheet Document", give it a name. After that, fill in the spreadsheet with the required data. For example:
    • Order for item No. [ReleaseNumber] from [ReleaseDate] - right-click - Properties - Layout - Filling - Template.
    • Create the columns you want to appear in your document.
    • Select the entered cells, click Table - Names - Assign a name - enter the name "Header".
    • Copy the line with the table headers, select them, right-click - Properties - Layout - Filling - Parameter.
    • Select the line, name it, for example, "String TH".
    • Create a footer: write Total, the cell in which the total amount should be displayed, name SumTotal, select "Parameters" in the properties.
    • Specify the person in charge, in the properties of the cell for displaying the last name, specify "Parameters".
    • Select the bottom rows and name the range "Footer".
  2. Now, in the input window, write the function for generating a printed form:

Function GeneratePrintForm(ReferenceToDocument,PrintObjects)
SpreadsheetDocument = New SpreadsheetDocument;
SpreadsheetDocument.PrintParameterName = "PRINT_PARAMETERS_InvoiceForVRTU";
ProcessingLayout = GetLayout("InvoiceForPaymentExternal");
// fill in the header
AreaHat = LayoutProcessing.GetArea("Hat");
AreaHeader.Parameters.DocumentNumber = LinkToDocument.Number;
AreaHeader.Parameters.DocumentDate = LinkToDocument.Date;
AreaHeader.Parameters.OrganizationName = LinkToDocument.Organization.Name;
//display the header in a spreadsheet document
SpreadsheetDocument.Output(RegionHeader);
//fill in the PM lines
StringScope =ProcessingLayout.GetRegion("StringP");
For Each CurrentRow From ReferenceToDocument.Products Loop
FillPropertyValues(RowArea.Parameters, CurrentRow);
SpreadsheetDocument.Output(StringArea);
EndCycle;
//fill footer
AreaFooter = LayoutProcessing.GetArea("Footer");
AreaFooter.Parameters.QuantityTotal = LinkToDocument.Products.Total("Quantity");
AreaFooter.Parameters.AmountTotal = LinkToDocument.Products.Total("Amount");
RegionFooter.Parameters.OwnerName = LinkToDocument.Manager.Name;
//output the footer into a spreadsheet document
SpreadsheetDocument.Output(RegionFooter);
SpreadsheetDocument.AutoScale = True;
Return SpreadsheetDocument;
EndFunctions

  1. Save your changes to the document.
  2. Now you need to activate the created form. For this:
    • Go to "Administration" - "Print forms, reports and processing" - "Additional reports and processing".
    • Click the "Create" button, select the external form file in the explorer, confirm the entry with the "Save and close" button.
  3. To check, go to Sales - Implementation (acts, invoices), click the "Print" button, select your form and check that it is filled out correctly.
  4. Print the document if needed.

Conclusion

We reviewed with you a sample of creating a printable form through the Print Designer and through the external form creation tool. We hope that everything will work out for you. Leave your questions in the comments.

So, why is it needed at all? For example, you need to change just a few characters in the layout of a printed form or add a line or remove something. Remove the configuration from support, so that later on with each update you experience difficulties? What for? It is better to use an external printing plate!

To create, we need processing that I found on the Internet, thanks to the author for this miracle "Designer of external printing forms". You can download and discuss it at: forum.-infostart.-en/-forum24/-topic74569/.

Let's start, processing starts in 1C:Enterprise. This is what the main window looks like:

For example, we need to change the printed form of the document "Incoming cash order", for this, in the Document type field, select it. We go into the configurator and copy the entire module of the document "Incoming cash order". Then paste it into the "Source text" field, as shown in the following picture:

The next step is the Build Tree button. Here, all that is required of us is to find the name of the procedure "Print" in the list of procedures, select it and click the "Select main" button. The processing itself will determine which procedures and functions are needed for printing, and in addition, the “need / not needed” button, I chose two procedures “Get the Structure of Printing Forms”, since the body of the procedure uses the “Create a GO Table for Conducting” function, then we also select it with the “need” button:

The next step is to enter the name of the layout that will be printed and which we will change, as shown:

We'll open it for inspection right away! The processing form will open, in the field we will select the required document for printing the cash register, the button of the form "Run" and the external printing form is ready.

From the processing form, you can also easily register an external printing form, for this there is a special button on the form, after which it becomes possible to print from a document. That's all, now you can make changes to the print layout. Good luck!

Layout constructor allows you to create layouts used both by the objects of the applied solution and by the applied solution itself as a whole. Layouts can contain various data that is required to display information as you work.

The constructor is called by the system automatically when creating a new layout (for example, when creating a new reference layout in the configuration window):

The constructor allows you to create both empty layouts and layouts containing some information. This may be an empty layout of a spreadsheet document, which resembles spreadsheets and is widely used in the formation of output forms of documents and reports; it can be an empty text document layout or a layout containing binary data.

The designer also supports creating layouts that contain an ActiveDocument (for example, a Word document, an Excel worksheet, or a CorelDRAW drawing). In addition, the designer allows you to create layouts containing HTML documents or geographic schemes. For reports that use the data composition system, the designer allows you to create layouts that contain a data composition schema and a data composition design layout.

The result of the designer's work will be the finished layout. For example, it could be an empty spreadsheet document layout.