1c editor of printed forms. Publications. Writing a request for a printable handicap

In this article, we will tell you how to fix a document printable template without using the 1C Configurator. What is it for? Let's say you are printing an invoice, but some text is missing in the printed form, and this text should be in every printed document of this type (for example, in every invoice for payment). Usually in this case a 1C specialist is called. In order not to do this, but after spending a few minutes to solve the problem without a 1C specialist and the Configurator, you can use the advice described in this article.

It should be said that not all configurations support this function. Such a function is definitely available in Enterprise Accounting 3.0 and Trade Management 11.

Let us tell in detail, using the example of the Invoice document, how to change its template in the BP 3.0 configuration, in UT 11 it is done in a similar way.

1. You need to click the icon ADMINISTRATIONat the top of the 1c: Enterprises panel, then on the left in the menu select " LAYOUT OF PRINT FORMS»A picture similar to the one in the picture will appear on the screen:

2. Find the layout we need in the list - in our example it is "Invoice-order". Note that on the right, in the Layout Owner column, the document to which the layout belongs is displayed. In our example, this is "Customer Invoice".

3. We click the left mouse button 2 times in the line we need, that is, in the "Invoice-order" and get into the window "How to open the layout?"

4. Select "For viewing and editing", as shown in the figure:

Window "For viewing and editing"

5. Click "OK".

6. We edit the table as we need it: we correct the text, add text to empty cells, change the font, highlight it in bold, insert pictures, pictures from files, etc. An article will be released soon about how to edit tables in 1C.

7. Press the cross on the "Invoice-order" tab and answer in the affirmative ("Yes" and "Complete changes") to save our changes.

That is, in fact, all that needs to be done.

For the Trade Management 11 configuration, changes to the layout of the printing plate are done in the same way.

If you are unable to complete any point of this instruction, then most likely this means that you do not have enough rights to change layouts printed forms... You need to ask the 1C administrator or system administrator to give you the necessary rights, and then everything should work out.

So! There is a configuration (for example, "Trade Management", version 10.3), and for it you need to develop an external printable. For example, take model document "Invoice for payment to the buyer" (although external printable forms can be created not only for documents, but also for reference books).

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 document "Invoice for payment to the buyer", 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 create an external processing file. Processing should contain three main points:
  1. Attribute "LinkObject" with the type "DocumentLink.InvoicePayment to the Buyer"
  2. Layout to be printed
  3. Export Function "Print ()" which returns a spreadsheet document
These actions can be seen in figure # 1

"Drawing the layout"

Our layout will contain two areas:
  1. The title (header) of the document (in this area the names of the organization and contractor will be placed), 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 cells and header cells contain parameters, not just text.

Function "Print ()"

Now the form is almost ready. It remains to write the programmatic filling of the fields of the spreadsheet document. These actions are performed in the module of the processing object, in a function called "Print", which MUST be exported.
Stage 1. Obtaining data for the header, filling in the header parameters, and its output into a spreadsheet document TabularDocument \u003d New TabularDocument; Layout \u003d Get Layout ("Our Layout"); Data Request \u003d New Request ("CHOOSE | SUBMISSION (InvoicePayable to Buyer.Contractor) AS A Counterparty, | PRESENTATION (InvoicePointingBuyer.Organization) AS Organization | FROM | Document.InvoiceToPayment to Buyer AS InvoicePointing & Payment | Data Query.SetParameter ("Link", LinkOnObject); Head \u003d Data Query.Run (). Select (); Hat.Next (); Area \u003d Layout.GetArea ("Header"); Region.Parameters.Fill (Header); TabularDocument.Display (Region); Stage 2. Receiving tabular data and line-by-line output of goods
Data Query.Text \u003d "SELECT | _Products.LineNumber, | PRESENTATION (_Products.Nomenclature) AS Nomenclature, | _Products.Quantity, | _Goods.Price, | _Products.Amount | FROM | Document.InvoiceGoods_Goods | To Buyer | Link \u003d & Link "; Fetch \u003d Data Query.Run (). Select (); Region \u003d Layout.GetScope ("Data"); While Selection.Next () Loop Area.Parameters.Fill (Selection); TabularDocument.Display (Region); End of Cycle; Stage 3. Return of spreadsheet document and print function Returning TabularDocument;

Add our external printing plate to 1C

We go to the menu "Service - External printing forms and processing - External printing forms"

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

  1. Load the external processing file
  2. We indicate for which document (or reference) of the configuration the printable is intended
  3. Recording changes

We print!

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


ATTENTION!This development algorithm is suitable ONLY for "Normal Application". Print forms for configurations in Application Guided mode are different!

The file of the printable form shown in the example can be

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

In 1C: Accounting 8.3 (revision 3.0), a wonderful opportunity has appeared. Now the user in 1C: Enterprise mode can easily edit the layouts of printed forms.

When can this be useful? Well, for example, there is a certain printed form, say, "Requirement-waybill" in which you make some changes every time after printing it. Change the font, print the margins, remove unnecessary things.

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

Below in steps I will show how to change the layout of the "Requirement-Invoice" printable. We will add a new field there: "Responsible".

1. Generate a printable (using the "Print" button) and click in the form that opens (on the right) "More" -\u003e "Change layout":

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

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

4. The printing form was re-formed in a new form as we wanted.

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

Respectfully, Vladimir Milkin (teacher and developer).

Consider writing the simplest printable in 1s 8.1 - 8.2 for example configuration Enterprise accounting 2.0... Let's say you want to write an external printable for a document: display the basic data of the document, as well as from the tabular section Products: nomenclature, price, quantity and amount.

You can download the resulting example by.

In the configurator 1C Enterprises 8 create external processing (File-\u003e New-\u003e External Processing), set the name, create the requisite required for the external printable ReferenceObject with type DocumentLink.Realization of GoodsServices.

Creating a layout of a printing plate

Add new layout, leave the layout type Spreadsheet document... Create three areas on the layout: Hat, Data and Basement... This can be done by highlighting the required number of lines and clicking the menu Table-\u003e Names-\u003e Assign Name (Ctrl + Shift + N).

After that, we begin to place text and parameters in the areas. We will display 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, set the property Filling in value Parameter.

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

Programming

Let's go to the module of the printable object Actions-\u003e Open Object Module.

Let's create a mandatory export function for printable forms. Print ().

Function Print () Export EndFunction

In the function, create a variable for spreadsheet document, in which the printed form will be displayed, we get layout and layout areas.

TabDoc \u003d new TabularDocument; Layout \u003d Get Layout ("Layout"); Header Area \u003d Layout.GetArea ("Header"); DataScope \u003d Layout.GetScope ("Data"); AreaFooter \u003d Layout.GetArea ("Footer");

Fill in the parameters hats and display it in spreadsheet document.

Captions.Parameters.TextHeader \u003d + ReferenceObject.Number; AreaHaps.Parameters.Organization \u003d ReferenceObject.Organization; TabDok.Display (AreaHap);

To get the rows of the tabular section Products we use the request.

Request \u003d new request; Request.SetParameter ("Link", LinkOnObject); Request.Text \u003d "SELECT | Sale of goods, services, goods, nomenclature, | Sale of goods, services, goods, amount, | Sale of goods, services, goods, price, | Sales of goods, services, goods, quantity | FROM | Document.Realization ofGoodsServices.Goods AS Sale ofGoodsServicesGoods | WHERE | Implementation of GoodsServicesGoods.Link \u003d & Link ";

Pass the props to the request parameter ReferenceObjectto indicate in the condition WHEREthat we only need the data of the document from which we display the printable. To get a fetch of a query, we first execute it and then fetch the rows.

Selection \u003d Query.Run (). Select ();

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

TotalSum \u003d 0; TotalQuantity \u003d 0; While Fetch.Next () Loop FillPropertyValues \u200b\u200b(ScopeData.Parameters, Fetch); TotalSum \u003d TotalSum + Sample.Sum; TotalQuantity \u003d TotalQuantity + Sample.Quantity; TabDok.Display (ScopeData); End of Cycle;

Fill in and display the area Basement.

AreaBoard.Parameters.TotalQuantity \u003d TotalQuantity; AreaBoard.Parameters.TotalSum \u003d TotalSum; TabDok.Display (Area Basement);

Returning the filled spreadsheet document from the function Print ().

return of TabDoc;

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

5. Connecting the printable to the document

IN typical configurations 1C 8 there is a directory for registering external printable forms External treatments... To connect, go to the menu in enterprise mode Service-\u003e Additional reports and processing-\u003e Additional external printable forms.

Add a new element of the directory, load the printable from disk and select the type of document.

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

Auto registration of printable

In order that when connecting the printing form it was not necessary to select the document type manually, you can configure auto registration... To do this, add a new layout and name it Auto-registration_Parameters(only this way) and in its first cell we write Documents.<Наименование документа> (or Reference books.<Наименование справочника> ).

Now, when connecting a printable, we will be prompted to use auto-registration parameters.

Today we will tell you how to work correctly with printed forms in 1C.

Now we will analyze the ways to manually edit a printable in 1C, depending on the versions. In general, if there are no additional complicating factors, this procedure is simple and quick. But there are some subtleties here. For example, the actions are simple only when you need to edit the data that will then be printed on the form. In some cases, in order to edit a printed form in 1C, you will need the help of a programmer or an experienced user, for example, when:

    it is necessary to correct the arrangement of various elements;

    you need to add several columns;

    it is necessary to change the labels or add missing ones.

Now, let's make a printable user data change. Let's take any account as an example.

To get started, open the invoice journal, then select an invoice to pay the buyer and generate 1C printable forms.


As an example, you can edit the invoice amount. Go to editing the printed form that opens in front of you. To do this, you need to click on the "View Only" button on the panel located in the upper corner of the printed sheet.


To go to the edits, you need to sequentially click the sections in the menu: table -\u003e view -\u003e edit.


As soon as the ban on editing is removed, you need to double-click on the cell with the data in which you are going to change the information. The printing form in 1C 8.2 after double clicking will be available for editing.


The above cases when you need to change the printable in 1C are used for one-time edits in printed document... That is, in the future, all these changes will not be saved. If you want to save the changes made, and so that they are present in the future, then this requires qualifications and certain skills. When needed, for example:

    change the order or name of columns;

    edit the names of the fields;

    change the number of fields;

    add additional information, etc.