1c 8 tabular document transcript

Question: Please tell me how you can do the following.

I have a query result displayed in a spreadsheet document, and there is a decryption for the cell.

I want that when double-clicking on a cell, a procedure is performed that, for example, starts a report on decoding a cell.

Answer: There are standard and non-standard decryptions.

I) Standard:

can be used both directly in a spreadsheet document and in the Tabular Document Field object (i.e. a spreadsheet document placed not in a separate window, but directly on the form).

For Decryption to work, 3 conditions must be met:

1) For the cell of the spreadsheet document from which we want to call Decryption, the Decryption Parameter property must be set. For example, we want to double-click on the cell with the name of the counterparty to open the form of the counterparty catalog item so that we can clarify some data that is not displayed in the report. Set the DecryptionParameter property to some value, for example, Counterparty Decryption.

2) In the process of displaying the layout areas in the resulting spreadsheet document, you MUST ASSIGN the decryption parameter to the value of the required type, for example:

Code 1C v 8.x TabDok \u003d New Tabular Document;
Selection \u003d Directories.Contractors.Select ();



// .................................................
Scope.Parameters.Contractor decoding \u003d Selection.Link;
TabDok.Display (Region);
End of Cycle;

3) Prohibition of cell editing with decoding must be ensured, i.e. need to indicate

TabDoc.View Only \u003d True;

otherwise, despite the promising appearance of the cursor, when you hover over a cell, you can click on it as much as you like, but nothing will happen.

II) Non-standard:

by double-clicking on the cell with the decryption, you can call your own procedure. To implement this, several conditions must be met:

1) Output of a spreadsheet document should be carried out in the Object of the Tabular Document Field;

2) A value must be assigned to the property of the cell DecryptionParameter, for example, Counterparty Decryption.

3) The parameter of decoding Counterparty Decoding is assigned the List of Values \u200b\u200bfilled in when forming the spreadsheet document with the necessary values \u200b\u200bor, more often, Structure. In particular, the name of a standard configuration report and parameters that need to be specified in the report form can be transmitted, for example, date period, account number, etc. And then this report is called as a procedure.

4) For the TabularDocumentField object, the ViewOnly property must be set to True.

5) The custom procedure code is placed in the procedure

Code 1C v 8.х TabularDocument Field1Decoding Processing (Element, Decoding, StandardProcessing)
// the first line should be like this:
StandardProcessing \u003d False;

I will give a small example that opens a subordinate directory for a "clicked" counterparty.

Code 1C v 8.x Procedure Button Form Press (Button)
Contractors \u003d Directories. Contractors;
Selection \u003d Contractors.Select ();
Tab \u003d Form Elements.TableDocumentField1;
Layout \u003d Get Layout ("Layout");
While Sampling.Next () Loop
If Sample.ThisGroup \u003d False Then
Region \u003d Layout.GetScope ("Row");
Scope.Parameters.Contractor \u003d Selection.Name;
.................................................................................................
StructureDecoding \u003d New Structure;
StructureRescription.Insert ("Counterparty", Sample.Link);
StructureDecoding.Insert (".......", .........);
.........................................................................
Scope.Parameters.Contractor Decryption \u003d Decryption Structure;
Form Elements.TableDocumentField1.Output (Area);
Otherwise
Proceed;
EndIf;
End of Cycle;
Form Elements.TableDocumentField1.ViewOnly \u003d True;
End of Procedure

Procedure Tabular Document Field1DescriptionProcessing (Element, Decoding, StandardProcessing)
StandardProcessing \u003d False;
Contracts \u003d Directories.Contracts.GetListForm ();
Contracts.ParameterSelectionBy Owner \u003d Decoding.Contractor;
Agreements.Open ();
End of Procedure

In this lesson, we will learn how to create tabular layouts in 1C, which can later be used for.

For example, how I formed layouts for.

I went to the processing form and went to the "Layouts" tab:

The spreadsheet document editor has opened:

In many respects, working in the editor is similar to working in Excel, but there are some features that I would like to dwell on.

What do I mean by area? These are several lines and several cells, in general, any part of a spreadsheet document that can be selected by us using the left mouse button.

Here is a selection of two lines:

And here's a selection with 2 columns:

Now we will select the area at the intersection of the first two rows and the first two columns:

So that's it. If we managed to select the area we need, then by right-clicking on it and selecting the "Properties" item, we can assign it a name by which we will refer to it from our code, forming a printable:

This is a basic skill that we must master to be able to make tabular layouts.

See already assigned names

Let's see what region names are already assigned in the layout?

To do this, select from the configurator menu:

Here is our newly assigned "Hat" area:

And if we now select it in the dialog and press "Select", then in the editor will be selected accordingly. cell area:

How to set an area parameter

Often, when forming a printable area, you need to do more than just pull the area out of the layout. You also need to fill in certain cells with certain parameters.

We set these parameters at the area and the specified values \u200b\u200bautomatically fall into the required cells.

To do this, in the properties of the cell we need (where the parameter value will be displayed) ...

We indicate in the field "Filling" the value "Parameter", and in the field "Parameter" we write the name by which we will refer to this parameter from the code:

If you specify in the filling not "Parameter", but "Template", then it will be possible to specify some text (template) in the cell itself using the parameter name in square brackets:

In this case, the parameter name (and its position in the template) is indicated in square brackets.

How do I set the decryption parameter?

The decryption parameter name is set in the same cell properties:

Later, from the code, we will assign this parameter (by the name "Nomenclature Decoding") the desired value (link to the item item).

And when the user double-clicks on this cell, the value assigned to the decryption parameter will open for him (in this case, the form of the item's item will open).

Further parting words

We've covered the necessary basics. Now investigate carefully.

Download this database too. in it the processing "ProcessingFor Testing".

There are tabular variants in its layouts. Explore them as thoroughly as possible, based on the techniques that we discussed just above.

Service