Editor of printing forms 1s 8.3. Publications

So! There is a configuration (for example, "Trade Management", edition 10.3), and for it it is necessary to develop an external printable. For example, let's take model document"Invoice for payment to the buyer" (although external printing forms can be created not only for documents, but also for directories).

Example for 1C 8.3 (Managed Forms)

An example of developing an external printable for a managed application can be viewed.

A task

Develop an external printed form that will be available from the "Invoice for payment to the buyer" document, and which will contain the name of the organization, counterparty and a list of goods with price, amount and quantity.

Go!

The first thing to do is to create an external processing file. Processing should contain three main points:
  1. Attribute "ReferenceToObject" with type "DocumentReference.InvoiceForPaymentToBuyer"
  2. Layout to be printed
  3. Export Function "Print()" which returns a spreadsheet document
These actions are visible in Figure 1.

"Drawing a Layout"

Our layout will contain two areas:
  1. The title (header) of the document (the names of the organization and the counterparty will be placed in this area), and the header of the table (with the names of the columns)
  2. Table with goods (columns, with name, quantity and amount)
Figure 2 shows the layout of the external printing plate. Note that the table and header cells contain options, not just text.

Function "Print()"

Here is the form almost ready. It remains to write the programmatic filling of the fields spreadsheet document. These actions are performed in the processing object module, in a function called "Print", which MUST be exportable.
Stage number 1. Getting data for the header, filling in the header parameters, and outputting it to a spreadsheet document SpreadsheetDocument = New SpreadsheetDocument; Layout = GetLayout("OurLayout"); DataQuery = New Query("SELECT | PRESENT(Invoice to Buyer.Contractor) AS Counterparty, | REPRESENTATION(InvoiceToPay.Organization) AS Organization |FROM | Document.Invoice to Buyer AS Invoice to Buyer |WHERE | Invoice to Buyer.Reference = &Reference"); QueryData.SetParameter("Reference", ReferenceToObject); Header = RequestData.Run().Select(); Header.Next(); Area = Layout.GetArea("Header"); Area.Parameters.Fill(Header); SpreadsheetDocument.Output(Region); Stage number 2. Receiving tabular data, and line-by-line output of goods
DataQuery.Text = "SELECT | _Products.LineNumber, | REPRESENTATION(_Products.Nomenclature) AS Nomenclature, | _Products.Quantity, | _Products.Price, | _Products.Amount |FROM | Document.InvoiceFor Buyer.Products AS _Products |WHERE | _Products. Link = &Link"; Selection = RequestData.Execute().Select(); Region = Layout.GetRegion("Data"); While Selection.Next() Loop Area.Parameters.Fill(Selection); SpreadsheetDocument.Output(Region); EndCycle; Stage number 3. Spreadsheet document return and print function Return SpreadsheetDocument;

Adding our external printing form to 1C

Go to the menu "Tools - External printing forms and processing - External printing forms"

In the element creation window that opens, perform the following actions:

  1. Loading the external processing file
  2. We indicate for which document (or directory) the configuration, the printed form is intended
  3. Writing down the changes

Printing!

Open any document "Invoice for payment to the buyer" (with the tabular section "Products" filled in, because it is from there that we take the data to fill in), click the "Print" button, in the window that opens, select OUR printable form, and click "Print"


ATTENTION! This development algorithm is ONLY suitable for "Normal application". Printables for configurations in Managed Application mode are different!

The printable file shown in the example can be

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

In 1C: Accounting 8.3 (version 3.0), a wonderful opportunity has appeared. Now a user in 1C:Enterprise mode can edit printable layouts quite easily.

When can it be useful? Well, for example, there is some printing form, say, "Demand-invoice" in which you make some changes every time after printing it. Change the font, print out the margins, remove the excess.

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

Below, step by step, I will show you how to change the layout of the "Demand-Invoice" printable form. We will add a new field there: "Responsible".

1. Create a printed form (by clicking the "Print" button) and click the button (on the right) "More" -> "Change layout" in the form that opens:

2. The printable layout will open. Make the necessary changes to it, but be careful that it doesn't work here. I will say right away that fonts and field sizes can be changed exactly, but to delete existing fields (especially those in<угловых скобках>) is 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, as it is required by the 1C program code.

3. We will add the "Owner" field and click the "Save and close" button.

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

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

Sincerely, Vladimir Milkin(teacher and developer).

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.

Instruction

Open the program "1C:Enterprise" version 8. Pay attention to the menu item "Service" - "External processing and printing forms". With it, you can store external reports, processing, printing forms, as well as processing the filling of tabular elements. You can also connect an external form instead of changing an existing one, which will interfere with the program configuration.

Launch 1C:Enterprise in the configurator mode, then create an external processing, to do this, run the command "File" - "New". In the window that appears, select "External Processing". A new external processing form will appear on the screen. Give it the name " External". Then add new props, called "Object Link", specify the type for it - "Document. Link. Realization of goods and services”. To create a printable for a different kind of document, use the appropriate link type.

Add a new layout by clicking on the appropriate button in the new form window. Name it "Layout", create an area named "Header", give it a "Header Text" option. Then click on the "Actions" button, select the "Open object module" command. Then insert the text of the module, you can use the example posted on the site http://www.uasoft.com.ua/content/articles/315/.

Launch 1C:Enterprise, go to the Tools menu, select External Printables. Make a new entry in the list of forms. To do this, select the created processing file, and in the tabular section indicate that the form belongs to the document "Sales of goods". Verify that the new printable is working properly. To do this, open the created document, swipe it, then click on the "Print" button at the bottom of the screen, select the "External printing form" option.

Sources:

  • how to change the printing form in 1s

In order to create and edit object forms, 1C:Enterprise provides a special form editor (or Form Designer). Forms of objects of the applied solution are intended for visual presentation of data while working with the program. The form editor contains several tabs that provide the ability to edit all form elements.

You will need

  • computer, program 1C

Instruction

Using the form editor, you can add one or more "Group - Pages" elements to the form, to do this, click on the green plus sign in the upper left corner of the editor, while on the "Elements" tab.
In 1C:Enterprise mode, all existing elements of a group will be displayed on a separate tab each. To place it above or below the working one, in the "Properties" window of a particular group in the item "Display"Select the appropriate command.

You can also add elements to the form by dragging the necessary details into the element tree. To make it easier to bypass form controls when editing or entering data, set the order that suits you by arranging elements in the tree and subordinating them to other elements, as well as setting the properties of group elements according to your needs.
To edit form attributes - change them, create new ones or delete them, use the panel in the attribute tree area on the corresponding tab.

To edit the command interface, go to the corresponding tab. You will have a command tree in front of you, the main branches of which are the “Navigation Bar” and “Command Bar”. Some commands are added to the command interface tree automatically, but you can also add them yourself by dragging the commands you need from the list of global (general) commands or from the list of form commands.

Form commands are edited in the corresponding list. You can add them, remove them from the list, set properties for each command using the properties palette, which you can call by clicking on the pencil icon in the command line of the list.
To edit the form parameters, go to the "Parameters" tab, where you can also add, delete, and set the desired properties.

Related videos

Chart of accounts used in accounting for display economic activity enterprises, supports a multi-level hierarchy: account - sub-accounts. So that the user can view the data contained in the chart of accounts and correct them, the 1C system allows you to change the account form. In addition, the printed form of the invoice can be changed in any other document in 1C.

You will need

Instruction

Analytical accounting is provided for each account or sub-account. Therefore, when creating and subsequently editing the chart of accounts in 1C, the required number of subconto, that is, objects of analytical accounting, can be supplied. Moreover, adjustments to accounts and sub-accounts can be made both by a user working with automated system accounting and software developer.

This article describes how to connect an external printing form to the 1C database using the Trade Management 11.2 configuration as an example.

The "Trade Management 11.2" configuration is a configuration on "MANAGED" forms!

Our instruction "shows" how to connect an external printing plate in information base 1C with a configuration on "MANAGED" forms, namely:

  • "Accounting 3.0"
  • "Trade Management 11.2"
  • "Salary and personnel management 3.1"
  • "Integrated Automation 2.0"
  • "Control small firm 1.6"
  • "Retail 2.2"
  • and other similar configurations.

In order to connect an external printing form in 1C, we need to go through 11 steps.

1 - Menu "NSI and administration" (In other configurations, such as in Enterprise Accounting 3.0, it may be called simply - "Administration"). 2 - Select "Print forms, reports and processing" (see the figure below ↓)

3 - Expand the "Reports and Processing" submenu (In other configurations, such as in Enterprise Accounting 3.0, such a submenu may not appear, so we immediately proceed to the next step). 4 - Check the box Use additional reports and processing. 5 - Go to the section: Additional reports and processing. (see pic below ↓) ()

6 - Click the "Create" button. (see pic below ↓)

In new versions of 1C (starting from August 2016), the program has a built-in warning mechanism about the dangers of using unknown external processing, which may contain "viruses", the warning will not appear in earlier versions of the program! If it has arisen, then to connect an external printing form it will be necessary - 7 - click the "Continue" button. (see pic below ↓)

8 - Select the directory in which the processing is located. 9 - We select it (the processing we need). 10 - Click the "Open" button. Or, instead of steps 9 and 10, you can simply double-click on the external printable we need in the selection window. (see pic below ↓)

If we need to add a location for the added processing (For example, this is the Universal Contract Form from our website and we need the print command for this form to be displayed in some object that is not initially displayed) — 11 - click on the placement line ("Place in:", maybe "Placement:") and select the necessary directories and documents. 12 - We complete the steps for connecting an external printing form by pressing the "Save and close" button. (see pic below ↓)

That's all! Congratulations! External printing plate connected! Have we done everything right? Let's check...

Before Recording and closing, we noticed that this external printing form is located in the document Sales of goods and services, which means that we open any document of the form: “Sales of goods and services” for printing. press the "Print" button and see - a window for selecting printing forms has appeared, among them there is - 13 — an external printing plate connected by us (see the figure below ↓)

Now it's all right. We hope this article was helpful to you.