How to set up smartphones and PCs. Informational portal
  • home
  • Reviews
  • External printing plate zup. Adding an external printable to the base

External printing plate zup. Adding an external printable to the base

Good afternoon.

Today I want to tell you how to create external printable forms for the "Salary and Human Resources 3.0" configuration. As you know, ZUP 3.0 uses a library of standard subsystems, which means that the processing structure looks completely different. When I first had to make a printed form for BSP in controlled forms (then it was UT 11), the first thing I did was to go to the ITS disk in order to find there detailed documentation about what export procedures, with what parameters should be processed and how it all works. Here ITS disappointed me a little, tk. everything is told about how the procedures should look in the document module, and in the external printed form the parameters of the "print" procedure are rearranged, so I had to look for information in other sources and pick the subsystem from the inside.

Well, let's start. What we get at the end can be used as a template.

Step one- obvious. We create a new treatment. Let's give it an arbitrary name: "PrintPrint".

Step two. Let's create a layout. Since we have a test case, I will create the simplest layout, without a single parameter.

Step three- The most interesting. We open the object module and start programming. According to the BSP, when registering an external processing, it (processing) must report what it can do, to which objects it is attached, how it is called. When asked what it can handle, it should return a list of commands - this is a table of values. In our case, processing is able to display one printable, so there will be only one command. To form a table of values, we define a couple of procedures that will always be the same in all external printing forms:

// procedure that prepares the structure of the command table

Function GetCommandTable ()

// Create an empty command table and columns in it
Commands = NewValuesTable;

// How the description of the printable will look for the user
Commands.Columns.Add ("View", New DescriptionTypes ("String"));

// The name of our layout, so that we can distinguish the invoked command in print processing
Commands.Columns.Add ("Identifier", New Description of Types ("String"));

// This is how the processing command should be called
// Possible options:
// - Form Opening - in this case, the identifier column should contain the name of the form that the system should open
// - CallClientMethod - call the client export procedure from the processing form module
// - CallServerMethod - call the server export procedure from the processing object module
Commands.Columns.Add ("Usage", New Description of Types ("String"));

// The next parameter specifies whether to show an alert when processing starts and ends. Doesn't make sense when opening a form
Commands.Columns.Add ("ShowAlert", New Description of Types ("Boolean"));

// For a printable, it must contain the line PrintMXL
Commands.Columns.Add ("Modifier", New Description of Types ("String"));

Return of the Command;

EndFunction

// Creates a new line in the command table

AddCommand Function (CommandTable, View, Identifier, Usage, ShowNotification = False, Modifier = "")
NewCommand = CommandTable.Add ();
New Team. View = View;
New Team. ID = ID;
New Team. Use = Use;
New Team. Show Alert = Show Alert;
New Team. Modifier = Modifier;
EndFunction

External Processing Information () Function Export
Registration Parameters = New Structure;
AssignmentArray = New Array;
Array of Appointments.Add ("Document.PriemNaRabotu");
Registration Parameters.Insert ("View", "Print Form"); // can be - FillingObject, AdditionalReport, Creating LinkedObjects ...
Registration Parameters.Insert ("Assignment", Array of Assignments);
Registration Parameters.Insert ("Name", "Hello world"); // the name under which the processing will be registered in the external processing directory
Registration Parameters. Insert ("Version", "1.0");
Registration Parameters. Insert ("Safe Mode", TRUE);
Registration Parameters.Insert ("Information", "SAMPLE"); // this is how the description of the print form for the user will look
CommandTable = GetCommandTable ();
AddCommand (CommandTable, "Hello World", "Layout", "CallServerMethod", True, "PrintMXL");
Registration Parameters.Insert ("Commands", CommandTable);
Return Registration Parameters;
EndFunction

Actually, you will have to poke around in it every time you create a new external printing plate. From a piece of code you can see that we will bind it to the document "Hiring", respectively, you write your own. The printed form will be called "Hello World", again we change it to our own. Here in the template it will be convenient to write an explicit bileberda so that it is conspicuous, so as not to forget to fix it later, in my opinion "Hello world" comes in handy. The version is for yourself, write what you want, it will be displayed in the form of an element of the external processing reference book. The word "SAMPLE" is also visible only in the form of a reference book of printed forms. Next, add a command, here the name of the button is passed to the second parameters, this is what the user will see in the document in the "print" menu item.

This set of three procedures is enough for the processing to be added to the directory of external processing, all this confusing code is service code and has nothing to do with the printing algorithm. In fact, the authors of the BSP forced us to program so hard, if earlier you immediately started writing the "Print" function, now, when you write processing from scratch, and not according to a model, you will spend time on the service. Previously, registration parameters were optional and were specified in the processing layout, now everything looks much more serious. The first impression when I saw this was cool, there are so many possibilities, everything is unified ... but in practice I always create just one command in one workspace, and attach it to one document. Those. in fact, I need two lines for registration: the name of the object, the name of the button. And here everything is so ... but oh well, it's not for me to judge.

Step four- no less interesting.

PRINT function?

But no, now not a function, but a procedure.

How to return the layout?

Send it to the function of the global module of the printing subsystem.

Okay

Here is the text of this procedure:

Print Procedure (ArrayObjects, PrintForm Collection, PrintObjects, OutputParameters) Export
If Print Control.You need to Print Layout (PrintForm Collection, "Layout") Then
Manage Printing.Output a Tabular Document Into a Collection (Collection of Print Forms,
"Layout", "Layout",
GenerateTabDocumentPattern (ArrayObjects, PrintObjects));
EndIf;
End of Procedure

Now for clarifications. The first line of the procedure contains a slightly incomprehensible condition. The fact is that when the print procedure is called, the system passes us a table of values, which indicates what we need to print. In fact, the PrintManagement.NuzhnoPostatMaket (...) function checks for the presence of a row in the table of values, in which there is a row with the name of the layout in the "NameVREG" column. In practice, in most cases, the thing is useless, because our processing will be able to form only one printing plate. Those. this condition can be omitted and it will not affect the performance.

Next Print Management.OutputTableDocumentInCollection (...) - it just adds the tabular layout where needed, so that it can then be displayed on the screen. If you need to show your spreadsheet document in your window (not in the standard window), then do not call this procedure, but just write your code here.

I also want to add that the Print procedure is performed on the client and, if necessary, you can open an arbitrary form here in order to ask the user for additional information necessary for printing.

Next, FormTabDocumentObject (...) is a function that we have to write in the processing module and which returns a spreadsheet document. In 100 out of 100 cases, it will be server-side, because we need to get the value of the attributes from the objects listed in the "ArrayObjects" parameter.

Step five- we form a layout.

Hurray, we will finally get down to the algorithm for forming the layout, receiving data, etc.

But in our sample we will act prosaically and I will not even comment here)))

GenerateTabDocumentPattern Function (ArrayObjects, PrintObjects)
tabDoc = New TabularDocument;
layout = Get Layout ("Layout");

AreaHeat = Layout.GetArea ("Header");
tabDoc. Display (areaHap);

Return of tabDocs;
EndFunction

That's all, thanks for your attention.

Question:

Please tell me where in 1C ZUP 3 add organization bank details so that they appear on employee certificates? For example, in Statement of income (free form) from the directory Employees.

Answer:

Seminar "Life hacks on 1C ZUP 3.1"
Analysis of 15 life hacks for accounting in 1s ZUP 3.1:

CHECK-LIST for checking payroll in 1C ZUP 3.1
VIDEO - monthly self-check of accounting:

Payroll in 1C ZUP 3.1
Step-by-step instructions for beginners:

The fact is that in 1C ZUP there is no need to store information about the organization's current account. It is not used in any document. Therefore, this information is not entered anywhere in the program and there is nowhere for them to get into the printed form.

There are two options. Either enter this information manually into the generated form each time, or enter this information once in layout of the printing plate(section of the Administration menu - Print forms, reports and processing - Print form layouts).

It is more convenient to use the second option.

In the list of layouts, you need to find the layout of the required printing form (the name of the layout coincides with the name of the form itself) and click the Change command. In the window that opens, you need to make the necessary corrections and write them down.

After saving the layout, these changes will be displayed each time this report is generated for any employee.

To be the first to know about new publications, subscribe to my blog updates:

Consider writing the simplest printable in 1s 8.1 - 8.2 on the example of the 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 Goods: 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 the name, create the requisite required for the external printable ReferenceObject with type DocumentLink.Realization of GoodsServices.

Creation of a layout of a printing plate

Add new layout, leave the layout type Spreadsheet document... We 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-> Names-> Assign Name (Ctrl + Shift + N).

After that, we begin to place the text and parameters in the areas. We will display in the header name of the printing 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 properties of a cell, 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-> Open Object Module.

Let's create an export function, which is required for printable forms. Seal().

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 = new TabularDocument; Layout = Get Layout ("Layout"); Header Area = Layout.GetArea ("Header"); DataScope = Layout.GetScope ("Data"); AreaFooter = Layout.GetArea ("Footer");

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

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

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

Request = new request; Request.SetParameter ("Link", LinkOnObject); Request.Text = "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 = & Link ";

Pass the props to the request parameter ReferenceObject to indicate in the condition WHERE that 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 = Query.Run (). 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 cycle, we calculate the total values quantity and sums... We will not fill in each parameter separately, but use the procedure FillPropertyValues ​​((<Приемник>, <Источник>) from 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 = 0; TotalQuantity = 0; While Fetch.Next () Loop FillPropertyValues ​​(ScopeData.Parameters, Fetch); TotalSum = TotalSum + Sample.Sum; TotalQuantity = TotalQuantity + Sample.Quantity; TabDok.Display (ScopeData); End of Cycle;

Fill in and display the area Basement.

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

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

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 a printable to a document

V typical configurations 1C 8 there is a directory for registering external printable forms ExternalProcessing... To connect, go to the menu in enterprise mode Service-> Additional reports and processing-> 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 to avoid having to manually select the type of document when connecting the printing form, you can configure auto registration... To do this, add a new layout and name it AutoRegister_Parameters(only this way) and in its first cell we write Documentation.<Наименование документа> (or Reference books.<Наименование справочника> ).

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

This article describes how to connect an external printable to the 1C base using the example of the "Trade Management 11.2" configuration

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

Our instruction "shows" how to connect an external printable form in the 1C infobase with the configuration on "MANAGED" forms, namely:

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

In order to connect an external printing plate 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 can be called simply - "Administration"). 2 - Choose "Printed 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, this submenu may not appear, so go straight to the next step). 4 - We put a "tick" in the Use of additional reports and processing. 5 - Go to the section: Additional reports and processing. (see picture below ↓) ()

6 - Press the button "Create". (see picture below ↓)

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

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

If we need to add a placement for the added processing (For example, this is a Universal form of a contract from our site and we need the command to print this form to be displayed in some object, which 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 to connect an external printing form by clicking the "Save and close" button. (see picture below ↓)

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

Before Recording and closing, we noticed that this external printable is placed in the document Sale of goods and services, which means that we can open any document of the type: "Sale of goods and services". press the "Print" button and see - a window for selecting printable forms has appeared, among them there is - 13 - external printing plate connected by us (see the picture below ↓)

Now for sure - everything. We hope this article was helpful to you.

Go to Service->Additional reports and processing->Additional external printing plates.

The form for the list of the reference book with external printable forms has opened. In the top menu of the list, click Add... The form for creating a catalog item appears.

Press the Open button and select the file with the desired printable form. After that, if necessary, set the required name (Name field).

If the printable contains auto-registration parameters, a message about this will pop up. Push Yes.If this is not the case, then you yourself must indicate to which document this form will be linked. To do this, add a line to the tabular section "Affiliation of the printable", where in the "Object representation" field select the type of document to which we are linking the form ... Since in our example this is an act of writing off materials, we select the document Requirement-invoice.

After that, go to any document Requirement-waybill, click Print, and select the form you just added.

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

To demonstrate how to add a printable in a managed interface, I will show how to add an external invoice form to a document of the same name in Accounting 3.0.

We go to the corresponding section of the program:


It is necessary that the sign of using external reports and processing be enabled, follow the hyperlink to the list of external objects:

In the list that opens, click Create:


In the dialog box, select the desired file:


The card of the external object is filled in: in the placement we see the type of the base object to which the form will be attached and just below its name:


Let's write and close the form of the created external object.

Now let's go to any document Invoice for payment to the buyer and display the print menu:


Top related articles