Adding a field to a 1c printable form 8.3. Publications. Creating an external printing form based on a standard one with minor changes

Let's consider writing the simplest printed form in 1s 8.1 - 8.2 using configuration example Enterprise accounting 2.0. Let's say you need to write an external printed form for a document: display the basic data of the document, as well as from the tabular part Goods: nomenclature, price, quantity and amount.

You can download the resulting example from .

In the configurator 1C Enterprises 8 create external processing ( File->New-> External processing ), set the name, create the required details for the external printed form Object Reference with type DocumentLink. Sales of Goods and Services.

Creating a printed form layout

Add a new one layout, leave the layout type spreadsheet document. We create three areas on the layout: Header, Data And Basement. This can be done by selecting the required number of lines and clicking menu Table->Names->Assign name (Ctrl+Shift+N).

After this, we begin to place text and parameters in the areas. We'll put it in the header name of the printed form, document number And organization, and also 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 you should set the property Filling in meaning Parameter.

In area Data let's create parameters for displaying rows in the tabular section( Nomenclature, price etc.), and in the area Basement for totals by quantity and amount.

Programming

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

Let's create an export function there that is mandatory for printed forms. Seal().

Function Print () Export EndFunction

In the function we will create a variable for spreadsheet document, into which the printed form will be output, we get layout And layout areas.

TabDoc = new TabularDocument; Layout = GetLayout("Layout" ); HeaderArea = Layout.GetArea("Header" ); AreaData = Layout.GetArea("Data" ); AreaFooter = Layout.GetArea("Footer" );

Let's fill in the parameters hats and bring it to spreadsheet document.

HeaderArea.Parameters.HeaderText = +LinkToObject.Number; HeaderArea.Parameters.Organization = LinkToObject.Organization; TabDoc.Output(HeaderArea);

To get table rows Goods we use the request.

Request = new Request; Request.SetParameter("Link", ObjectLink); Query.Text = "SELECT | Sales of Goods and Services Goods. Nomenclature, | Sales of Goods and Services Goods. Amount, | Sales of Goods and Services Goods. Price, | Sales of Goods and Services Goods. Quantity|FROM | Document. Sales of Goods and Services. Goods HOW to Sale of Goods and Services Goods|WHERE | Sales of Goods and Services Goods. Link = &Link";

We pass the details to the request parameter Object Reference, to indicate in the condition WHERE, that we need data only from the document from which we derive the printed form. To get a sample query, we first execute it and then select the rows.

Select = Query.Run().Select();

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

TotalSum = 0 ; TotalQuantity = 0 ; While Selection.Next() Loop FillPropertyValues(AreaData.Parameters,Selection);

TotalSum = TotalSum + Sample.Sum; Basement.

TotalQuantity = TotalQuantity + Sample.Quantity;

TabDoc.Output(AreaData); EndCycle ; Seal().

Fill and display the area

AreaFooter.Parameters.TotalQuantity = TotalQuantity; AreaFooter.Parameters.TotalSum = TotalSum; TabDoc.Output(AreaFooter); Returning the completed spreadsheet document from the function return TabDoc; If you are using one of the standard configurations, then after returning the spreadsheet document.

1C

will display the printed form on the screen. You can also use the spreadsheet method for output. Show() 5. Connecting a printed form to a document IN standard configurations 1C 8 There is a directory for registering external printed forms.

ExternalProcessing

. To connect, go to the menu in enterprise mode Service->Additional reports and processing->Additional external printed forms Add a new directory element, load the printed form from disk and select the document type.

Now in the document

Sales of goods and services A new printable will appear. Auto-registration of printed form To ensure that when connecting a printing form you do not need to select the document type manually, you can configure auto-registration . To do this, add a new layout and call it<Наименование документа> Settings_Auto-registration (this is the only way) and in its first cell we write<Наименование справочника> ).

Now, when connecting a printing form, we will be asked to use auto-registration parameters.

2016-12-01T12:56:42+00:00

A wonderful opportunity has appeared in 1C: Accounting 8.3 (edition 3.0). Now a user in 1C:Enterprise mode can easily edit printed form layouts.

When might this be useful? Well, for example, there is some printed form, say, “Demand-invoice”, in which you make some changes every time you print it. Change the font, reprint the fields, remove unnecessary things.

So why do this every time?! If we can make these changes to the layout of the printed form once, the program will always output the printed form as we need.

Below, step by step, I will show you how to change the layout of the “Demand-invoice” printed form. We will add a new field there: “Responsible”.

1. Create a printable form (click the “Print” button) and click the “More” -> “Change Layout” button in the form that opens (on the right):

2. The printable layout will open. Make the necessary changes to it, but be careful that it doesn't work out like this. I’ll say right away that fonts and field sizes can be changed absolutely, but deleting existing fields (especially those in<угловых скобках>) not worth it. If you want to hide a field in<угловых скобках>, just make it invisible (color or size), but it should remain on the form, since it is required by the 1C program code.

3. We will add the "Responsible" field and click the "Record and Close" button.

4. The printing form was reshaped in a new form as we wanted.

If, after changing the printing form, it stops working, then you.

Sincerely, Vladimir Milkin(teacher and developer).

As is known - without a piece of paper you... no serious business can do without. And when we say that 1C has some kind of electronic documents, the question immediately arises of how to print them in paper form.

The process of printing an electronic document 1C is called printing form 1C.

Each document can have several 1C printed forms. For example, the document Sales of goods and services (i.e. sale) is printed in 1C printed forms: TORG-12, Invoice, Consignment note, Certificate of services rendered, and so on.

The essence of the 1C printed form is a template (such as an Excel document) in which variables are specified. During the printing process, text from the electronic document is substituted for variables. The template is usually stored in the configuration.

The problem with changing a standard 1C printed form is that it is usually not advisable to change the standard configuration, otherwise it will be more difficult to update. Therefore, various methods for using external 1C printing forms appeared and began to reinvent the wheel.

An external 1C printing form is a printing template that is stored somehow separately from the configuration itself.

However, this is all theory. How to create your own printed form? Or better yet, how to make changes to an existing one?

How a 1C document is printed

To print any 1C document (which can be printed), you need to click the Print button in the document. 1C will offer to select a 1C printed form for this document from the list.

To the left of the Print button there is usually a quick access button to the last selected 1C printing form.

The print result looks like this. To print it to a printer, you need to place the cursor in the 1C printing form, press Ctrl+P or the printer button on the button panel or in the File/Print menu.

Print settings (margins, sheet orientation, etc.) are located in the File/Page Setup menu. You can also configure the user settings to print directly to the printer.

Where does this printing form come from?

Where is the 1C printed form located?

Let's go to the configurator. Find it in the configuration window required document. Let's expand its Layouts branch. It is they who turn into the 1C printing form when printed.

However, it will not be enough - we were offered to choose many more options when printing. The fact is that many 1C printed forms layouts are hidden in another place.

Let's go back to the top of the 1C configuration window. Let's open the General branch, and then the General Layouts branch. This is where most of the layouts are located. This is especially true for state-regulated printed forms 1C - TORG 12, Invoice, etc.

By the way, it’s not difficult to notice that you will see several layouts of TORG12 or Invoice. Why? It's easy to explain. Laws and requirements change periodically. But we can't just change the same layout - and if we have to print the document from a date that is earlier than the change date. Therefore, several layouts are made and, depending on the date of the document, the correct one is used.

But that's not all! There are also external layouts. Where are they stored?

Let's return to 1C Enterprise mode. Via the user menu with administrative rights Operations/Directories, select the External processing directory.

The lines of this directory, which have the form Printing form, add printing options for the document specified in the table Ownership of the printing form (in the picture this is Sales of goods and services).

In order for this to work, you must make an external processing that has a Print() procedure in its object module labeled Export, which organizes the printing process.
But we are getting ahead of ourselves. Let's first look at how the layout of the 1C printing form is organized.

Layout of printed form 1C

The layout of the 1C printing form looks like this.

As you can see, it is divided into blocks. Blocks can be horizontal (name on the left) or vertical (name at the top).

The layout itself, as it is, is not printed. Individual blocks are printed. The programmer in the print processing procedure specifies the order of blocks and the number of repetitions of each block. The result is a printed form.

In order to assign an area, select several rows (or several columns) and select Table/Names/Assign a name from the menu. To remove, there is also the Remove name command.

The name is needed so that the area can be accessed from program code. The name can be assigned not only to rows or columns, but also simply to several cells. To do this, select the cells and select the same menu.

However, by default, custom cell names are not displayed. To see them, select the menu item Table/Names/Display named cells.

So, today we learned that a 1C printed form is formed using a layout. The layout consists of blocks – cleverly called areas.

Typical (commonly used) blocks for printing plates:

  • Header – the title of the document is displayed
  • Row – one row of the table is displayed, this block is repeated as many times as the rows need to be printed
  • Footer – the end of the document is displayed.

Now we need to deal with the

It's no secret that, although nowadays more and more 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 authorities are primarily interested in paper documents. Therefore, if you actively use for financial control program 1C: Accounting or Enterprise, it is important to know how to print an electronic document created using the program.

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

For this, the developer has provided an excellent tool - Print Designer. With its help, 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 cannot be changed under any circumstances. This, in particular, may include an act of completion of work, some invoices or payments.

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

First, it’s worth understanding what, in general, a printed form is in 1C 8. This is a 1C spreadsheet template (like Excel), in which some variable rows are specified, filled with data from the program when drawing up a document.

Printing forms come in two types:

  • Internal (built-in). They are stored in the program configuration, so it is better not to change them, as problems may arise later during the update.
  • 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 incoming or outgoing operation, for example, writing out a report of completed work, you click the “Print” button to print the documents. The list displays a list of printable forms that are already filled with entered data about the transaction performed and your company. By clicking the type of document you need, you open a preview window so you can make sure the data you filled in is correct. The print button prints 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 printed forms stored?

You can view the built-in printed forms both in the configurator mode and in the normal enterprise mode. In the first case, you need to click the corresponding button in the start window when starting the program. You will see the program menu, find the “Sales of Products and Services” branch, which contains the “Layouts” item. It often contains only two items - “Invoice” and “Act”. Where is everyone else then, since the list is much more extensive? They're 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” - “Layouts of printed forms”. It will display all document layouts. It is noteworthy that they can be edited in the same menu.

As for external forms, you first need to either create them through the configurator mode, or by downloading a ready-made file, and then connect them to the “Administration” menu - “Printed forms, reports and processing” - “Additional reports and processing”. We'll talk about this a little later.

Creating a simple form using the built-in Print Designer

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

  1. First of all, launch into the Configurator mode, find the document you need, for example, Sales of Products and Services, in the document properties go to Actions - Designers - Print Designer.
  2. When prompted for a work option, select Regular Forms.
  3. Give the new layout a name, for example, “Print Invoice.”
  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 details appear in the right column.
  5. Mark the details to be displayed in the table section. The selection of details follows the same principle as in the previous paragraph.
  6. In the same way, select the details of the lower part of the document.
  7. At the final stage of creation, select whether you want to print immediately without preview, whether you need to protect the table, and then confirm the creation of the form with the OK button.

Creating an external printing form

Forms created through the Print Designer can be compared to a visual software 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 however 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 can prepare for you the required form, will provide it to you as a ready-made file, which you just activate with a few clicks of a button.

Now let's talk more about the procedure itself. Let's look at the example of creating an “Invoice” layout for the document “Sales (acts, invoices)”.

  1. Open the 1C 8 program in Configurator mode.
  2. Click File - New - External Processing, give it a name (it should not 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 InformationOnExternalProcessing() Export
Registration Parameters = New Structure;
ArrayDestinations = New Array;
Array of Assignments.Add("Document.Sales of Goods and Services"); //Specify the document for which we are making an external print. form
Registration Parameters.Insert("View", "PrintForm"); //maybe - PrintableForm, Filling Object, Additional Report, Creating Related Objects...
Registration Parameters.Insert("Destination", Array of Destination);
Registration Parameters.Insert("Name", "Order for sale of goods"); //name under which the processing will be registered in the directory of external processing
Registration Parameters.Insert("SafeMode", FALSE);
Registration Parameters.Insert("Version", "1.0");
Registration Options.Insert("Information", "This printable form was created as a sample");
CommandTable = GetCommandTable();
AddCommand(CommandTable, "External Order", "ExternalOrder", "CallServerMethod", True, "MXL Print");
Registration Parameters.Insert("Commands", CommandTable);
ReturnRegistrationParameters;
EndFunction // Information ABOUT External Processing()
Function GetTableCommand()
Commands = New ValueTable;
Commands.Columns.Add("View", New TypeDescription("Row"));//what the description of the printing form will look like for the user
Commands.Columns.Add("Identifier", New TypeDescription("String")); //print form layout name
Commands.Columns.Add("Usage", New TypeDescription("Row")); //Call ServerMethod
Commands.Columns.Add("ShowAlert", NewTypeDescription("Boolean"));
Commands.Columns.Add("Modifier", NewTypeDescription("Row"));
Return Team;
EndFunction
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 in any folder on your hard drive, name it appropriately.

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

Add Command(Table of Commands, “External Order”, “External Order”):
Procedure Print(Array of Objects, Collection of PrintForms, PrintObjects, Output Parameters) Export
Print Management.Output TabularDocumentIntoCollection(
Collection of Printing Forms,
"External order"
"External order"
GeneratePrintForm(ArrayofObjects, PrintObjects);
EndProcedure // Print()

  1. Insert a layout for filling out the printed form 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 out spreadsheet the necessary data. For example:
    • Order for product No. [Realization Number] from [Realization Date] - right-click - Properties - Layout - Filling - Template.
    • Create the columns that you want to appear in your document.
    • Select the entered cells, click Table - Names - Assign a name - enter the name “Header”.
    • Copy the row with the table headers, select them, right-click - Properties - Layout - Filling - Parameter.
    • Select a line and name it, for example, “StringTCH”.
    • Create a footer: write Total, the cell in which the total amount should be displayed, name it TotalTotal, select “Parameters” in the properties.
    • Specify the person responsible, and in the cell properties for displaying the last name, specify “Parameters”.
    • Select the bottom rows and name the range "Footer".
  2. Now in the input window, enter the function for generating a printed form:

Function GeneratePrintForm(LinkToDocument, PrintObjects)
TabularDocument = New TabularDocument;
TabularDocument.Name of Print Parameters = “PRINT_PARAMETERS_Invoice for Payment to VRTU”;
Processing Layout = GetLayout("Payment InvoiceExternal");
//fill the header
AreaHeader = ProcessingLayout.GetArea("Header");
AreaHeader.Parameters.DocumentNumber = LinkToDocument.Number;
AreaHeader.Parameters.DocumentDate = LinkToDocument.Date;
AreaHeader.Parameters.OrganizationName = LinkToDocument.Organization.Name;
//output the header in a spreadsheet document
TabularDocument.Output(HeaderArea);
//fill in the PM lines
RowArea = ProcessingLayout.GetArea("ROW");
For Each Current Line From Document Link.Products Cycle
FillPropertyValues(RowArea.Parameters, CurrentRow);
TabularDocument.Output(RowArea);
EndCycle;
//fill the basement
AreaFooter = ProcessingLayout.GetArea("Footer");
AreaFooter.Parameters.QuantityTotal = LinkToDocument.Products.Total("Quantity");
AreaFooter.Parameters.AmountTotal = LinkToDocument.Products.Total("Amount");
AreaFooter.Parameters.ResponsibleName = LinkToDocument.Manager.Name;
//output the footer to a spreadsheet document
TabularDocument.Output(AreaFooter);
TabularDocument.AutoScale = True;
return TabularDocument;
EndFunction

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

Conclusion

We looked at an example of creating a printable form through the Print Designer and through the tool for creating external forms. We hope everything works out for you. Leave your questions in the comments.

How to add (register) an external printed form (or processing) in 1C Accounting 8.3 (revision 3.0)

2019-05-15T13:40:54+00:00

Often an accountant needs an additional printed form for one of the standard documents 1C: Accounting 8.3 (revision 3.0). Or additional processing is needed, for example, to automatically fill out a document or enter a new one based on it. Usually someone has already developed such a feature and it can be found or ordered from a programmer. And now the revision has been received, all that remains is to add it to the accounting department. How to do it? More on this below, step by step.

1. Open 1C Accounting 3.0 and select the “Administration” -> “Print forms, reports and processing” section in the left panel:

2. Here, find and select “Additional reports and processing”, after checking the “Additional reports and processing” checkbox on the left:

3. Click the "Add from file..." button.

4. And select the file with external printing form or processing (epf extension).

5. In the new window, click the "Save and close" button.

6. Open the desired document and make sure that another printable form option appears in the print button or an item in the “Create based on” menu or a new button on the form toolbar. Ready!

Sincerely, Vladimir Milkin(teacher and developer).