Using SCD to print documents. Using the data source in the form of an object
In order to avoid comments like "I also discovery to me!", I will make a reservation immediately: the article is designed for inexperienced SCD developers, those who do not know how to express their "fi!", Understand what is obvious to you - it does not always happen obviously the rest .
For a visual representation of the implementation of part of the tricks, I made small blanks in the form of external SCD schemes. The description of the tricks and the screenshots tried to do so that the essence and technique of realizing the trick were clear without the need to download schemes. For someone, it will be quite enough, but if something is incomprehensible, you can always download the appropriate scheme and see directly implementing.
Trick number 1. Multiple of the right value.
So, for heating, we'll start with something easier. In such CCD mechanisms, as "selection" or "conditional formatting", you probably faced the "field" columns (or "left-value") and "value" (or "right value"). Professionals probably know this trick, but beginners it is not always easy to guess that the data layout field can be used both on the left and right (i.e., to compare not only the specified fixed values, but also others fields of SCD within one line). To do this, it is enough in the right value field to go into edit mode, press the value of the cleaning button ("slit"), then press the type selection button appeared (the letter "T") and select the type of "Data Layout" type.
Example. As an example, I did not reinvent the bike, and took the most ordinary operating statement of the account 60 from the demo version 1C: Accounting (I use Ed. 2.0.). Who does not know, starting with the edition 2.0, this report is made on the basis of the CCD.
So, set directly in it for lines with the condition "bu (turnover)" equal "bu (turnover)", and also apply to the report conditional design, highlighting the yellow cell of the lines, where "CT (con. Saldo) "More" bu CT (turnover). " If anyone knows how to enable the "Design" panel - find the "Settings panel" options button to the right of the "Settings panel".
The final result should be like this:
Trick number 2. Selection on groups.
Everyone knows what selection is in the LCD, but not everyone knows that it can be applied not only for the report as a whole, but also on separate lines and columns. Applied tasks for the use of such a product. For example, conditional detail (restriction for which upper level groups output detail, and for what no), or variable detail (for different values \u200b\u200bof top-level groupings, output different decodents). At one of the projects, the UPP, for example, had to make the form of cost calculation with a fixed structure (a separate directory) and for different calculation articles to display decoding or by costs, or for specific costs or not to output anything. Thanks to this, the trick did not have to give up the SCD when developing a report.
Example. The purpose of the Example: Display an AD, in which for settlement accounts (60.62.76) Show decryption according to counterparties, and for cost (20,23,25,26) - according to costs.
The SCD itself is implemented as a data set, which uses a request to the virtual table of residues and revolutions of the accounting register "Hoshchestnaya". We place the invested groupings "Organization" and "Account". In the "Account" grouping in parallel to place 2 "subconto1" and "subconto2" groupings, for which we set the appropriate selection. An illustration of the setup is in the screenshot:
If in the main report settings on the "Other Settings" tab, you did not disable the outclothes, then it will definitely need to be done in the "other settings" of our groups "subconto" and "subconto"
Trick number 3. Invisible hat
The next trick can be represented as a continuation of the previous one. If you drew attention, in the resulting report, despite the fact that in fact, only one subconto is derived from us, both (and "subconto" and "subconto") fall into the header. Unfortunately, the CCD developers did not provide for the possibility of regulating the visibility of the cap or using some service symbol, when installing which as a header, the field cap would not be formed. But, as you already, probably guessed there is a trick, which to some extent will help to circumvent this restriction.
When developing a scheme in a predefined layout of the design, add the grouping layout, with the definition by the name of the Invisible grouping, as shown in the screenshot. Please note that the field "area" should remain empty!
And then set the "Subconto2" name "Invisible":
And voila ... the "subconto2" grouping hat disappears, and the report becomes like this:
Ask why the design layout is set through the name, and not through the specification of a particular field of grouping? It is just that a more universal solution is obtained and subsequently, this group name can be set in the version of the report on any grouping, but it will not be possible to change the predetermined layout in the options.
Yes, there is another nuance of this trick: consider that the "invisible hat" covers not only this grouping, but also all the downstream! Those. If you assign the name "invisible" to the "subconto" grouping, then in the header will not be visible "subconto1", nor "subconto2"!
Trick number 4. Call me as you want
Most SKD developers know how to set the query field header. On the CCD tab "Data sets", it is enough to put a tick of the cancellation of the automaker and make the necessary text in the "header" field. The minus is that user modeThis method is unavailable, and I want to rename the title without resorting to the help of the configurator. So in the settings of the report options, there is not only the way to rename the headers of the fields, but also to "cover" their grouping "cap". To do this, on the "Selected fields" tab, select the desired fields and click the right mouse button. As you can see on the screenshot for fields, the "Install the header" and "field" options are available. Please note that for grouping fields, the header installation must be made alone through the "Selected fields" bookmark, and not through the context menu "Set the name" in the top (structural) part of the option setting!
After all settings, the report version looks like this:
P.S. A small tip for those who will download the scheme. The scheme is one, but all the tricks are made in the form of separate options for the report of this scheme:
To be continued...
Features of creating reports in 1C V8 in a thick client mode
How to make a choice of option?
Place the "Selectavariant" button on the report panel.
On the form we put the field "Nadat"
Sample code: Procedure of the form formulation of collecting (button) mock-up \u003d receipt ("BasicChemComponicid"); SOULDS \u003d new list of accommodation; For each option from the layout. Ravidnae. Cycle is related. Addly (option. Involutions, option. Convection); EndCycle;
choice \u003d SOULDS.SHIRTElement (); If the choice \u003d is uncertain then refund; Ended;
Folder settings. Clipputs (choice. Relationship);
Shape (); Extrudresses
The procedure for notifying (element) to form (); Extrudresses
Procedure to form () elementforms. Result. Operate (); Folders. Instruments. Installs. Parametrous. Setting the recognition ofparameter ("period", Nadat); Condigue results (elementforms. Result); Extrudresses
Operating procedure () Nadat \u003d Current Data (); Shape (); Extrudresses
Features of creating reports across SCD
Phased creation of the report
Create a report in the report node
Create a layout in the report, the type of which is the data layout circuit
In the report properties, set: the main data layout scheme \u003d created layout
In the report properties, install the subsystem that it belongs (the report in the company will be withdrawn in the upper navigation panel)
Create a query in the layout (Item: Add Data Set - Request)
In the Parameters tab, the layout must remove the checkboxes in all rows in the limited accessibility column - i.e. All parameters will be available for editing the user.
In the Settings tab, the layout is necessary in the window where the report node is displayed, create a new grouping without specifying the grouping field - a detailed string will be created
In the Settings tab at the layout, in the window where an additional set of bookmarks is displayed, select Add. Bookmark Parameters - Mark all parameters check mark and on each parameter Press the user settings element property button, the parameter settings window will open, where you want to put a check mark - Enable the parameter in Custom Settings
In the Settings tab at the layout, in the window where an additional set of bookmarks is displayed, select Add. Bookmark Selected Points - You need to add speakers that will be displayed in the report
Run the company, open the report, set the parameter values, form (check that the main version of the report formation is selected)
How to add user-unreactible parameter?
For example, we need to set the request parameter "Information base"
In the form of layout layout on the Parameters tab, the desired parameter to remove the Flags "Include in the available fields" and "Availability Limit"
In the form of layout layout on the Settings tab on the subset (bottom) parameters from the desired parameter to remove the flag, open properties (button with a wrench), in this form:
Remove the Flag "Enable in Custom Settings"
Edit mode Set "Inaccessible"
In the report form module in the handler of the "Confruitmentariant Server" event (you can and open, but not the server, because it is running before downloading the report settings and the settings will be overwritten) to programmatically set the parameter:
// Setting the Setup Parameter \u003d Report. Support Spaces. Increases; Settings. Parametrical. Installation of parameter ("information bond", report. Informational Base); Extrudresses
How to set report options?
In the form of layout layout on the Settings tab, you can create the necessary report options in the field on the left field.
How to set groupings?
In the form of layout layout on the Settings tab in the field on the right, you can create the necessary groupings
How to display a report?
In the module form:
& Comblete Procedure To formatevently ()
Etform.Conal results ();
Extrudresses
How to test the report?
Need to perform:
To form a situation in the client test - most convenient through the table of situations
get the form of the report - form \u003d Options ("Report. DeviumProcessions. Form. Formount");
download the desired report option - set the parameter to extend the keyword form "keyword" (setting name in the layout of the data layout)
download need settings Report -? Fill out the expansion parameter of the "Custom-to-line" report (type "User -StereNeworkCompon") so it did not work, everything is difficult, see below.
open form - Form. Open ()
perform formation - form.Conal count ();
check the contents of a tabular document form. Result - it would be nice to have comparison functions with the reference MXL
close the form - form. Place (); - Or maybe you can not open, you need to check
see also
description: Help menu / Sack assistant / tab Contents / Interface managed applications / expansion objects managed form/ Expansion of the managed form for report / form parameters
How to download the desired report settings?
The documentation describes that there is such an expansion parameter of the "custom-in-line" type of "custom-in-line" type, but there is a very complex object structure, failed to use it.
Really working diagram:
1. Create parameters in the report
Standard period period
Selection of the type of list (it would be better to structure, but it is not in the list of parameter types, as well as an arbitrary type)
2. In the Options procedure, we pass the necessary parameters:
period \u003d new standard deode; Period. Radio \u003d Option StandardThe viewer. Propoleteperiod; the period. Datahank \u003d flowing; period. Dataoconse \u003d tomorrow;
selection \u003d new list of accommodation; selection. Addly (testing. Pour to the object (missitation, "BP1"), "BiznesProcess");
& Nasserver Function Space (Speciscripts, View) Export for Each Element from Specis Cycle If an item. Holding \u003d Presentation then Returning Element. Ended; EndCycle; Return is undefined; Endfunction
& Nasserver procedure to set user-to-user setup (settings, name, value) for each element from the setting. The elements cycle if the typcumber (element) \u003d type ("value-parameter-component)) then if the string (element. Parameter) \u003d name then element. Element. Using \u003d truth; Ended; Ended; EndCycle; Extrudresses
& Nasserver procedure for setting user-based selection (settings, name, value) for each element from the setting. The elements cycle If the typcumber (element) \u003d type ("uniform-free") then for each selection from the element. The elements cycle. If the string (selective) \u003d . Doomination \u003d value; Selection. Using \u003d truth; Ended; EndCycle; Ended; EndCycle; Extrudresses
<> "00010101" Then the settings \u003d report. Supercrower. Install the user-based setup (settings, "period", parameters. Period); Ended;
speed \u200b\u200bSpeed \u200b\u200b(Parameters. Parameters, "BiznesProcess"); If the squeezesprotsess<> It is indefinitely to establish the user-based selection (settings, "biznesprotsess", fessess; Ended;
Extrudresses
Remarks:
There are parameters, that is, what is installed in the parameters of the QC request parameters
Some of them are assigned to setting up the option in custom settings (in the parameter properties there is a "Enable in Custom Settings" flag
Even if you download the desired values \u200b\u200bon the server to download the desired values \u200b\u200bon the server, then the form on which the settings saved last time are automatically loaded. These fellows in the formation of the report "interrupt" data settings
In the handler of the load-to-using the maintenance server, the transmitted setting object is copy Real settings, therefore, to change the settings that appear on the form, you need to fill the object report. The factory.
How to make multiple (list) query parameters in SKD?
In the query you need to use expression "In (& name parameter)" (See Logic Expressions in Query Language 1CV8)
In the setup layout of the SCD schema on the "Parameters" tab, for this parameter, you must put a check mark in the "Available list" column. In this case, when selecting the SCD parameter, it gives the form of editing a list in which you can add any value of parameters.
How to make disconnected query parameters in the CCD?
In the request of the CCD it is necessary to use constructions surrounded by figure brackets "{}"
.
If the checkbox in the form of the report (the fast setting panel) from the corresponding parameter is removed, then this design is removed from the query.
Read more Expanding query language for data layout system (1CV8)
How to make a report with a turn by columns?
To do this, in configuring a report option (editing the layout of the data layout, the "Setup" tab, the field on the right above), you need to add "Table" as the first group.
After that, in the "Table" node, the "Lines" and "speakers" branches appear, where the necessary groupings are added.
How to configure field output format?
In the data layout layout editor on the Data Sets tab, there is a list of report fields.
There are two possibilities:
Configure the value of the "Expression of Representation"
here you can enter a language expression issuing the desired string.
with resource fields it does not work
Set up the value of the "Design" column
in the design there is a "format" property - this value similar to the parameter of the Format language function, you can specify the desired view
type conversion here not to do
For resource fields, you can specify the calculation expressions ("Resources") - for example,
Amount (time) /3600.0
to transfer from seconds to hours.
The desired accuracy can be set through the "Decor" field on the "Data Sets" tab.
Features of setting the data layout parameters
There are also various processing of at least three types of parameters:
Parametes
The parameters are defined in the query (data source) of the CCD.
Data settings are transmitted to the data source request and determine the recoverable data.
There is a special property to work with data settings in the plane Planners. Instruments. Installations. Paramettime
Can be set by call view
Settings \u003d report. Support workers. Involutions; Settings. Parametrical. Installation of parameter ("information bond", report. Informational Base);
Selection
The selections are superimposed on the data obtained. after Extract from the data source.
The object of the folder is a special property to work with selections. Looksmaster. Instruments. Tallulation.
For example: Settings \u003d report. Support workers. Involutions; Settings. Parametrical. Installation of parameter ("information bond", report. Informational Base);
For each element from the parameters. The collection of the elementbar cycle \u003d settings. Treatment. Elements. Addly (type ("elementotorbone-free")); Elementatub. Environmentalization \u003d vocational assemblyCompon. Elementatub. Aversion \u003d New Poland-shaped (element. Condition); Elementatub. Decision \u003d Element. Relationship; EndCycle;
Customenstroy
Custom settings define the data that the user can configure on the form.
Custom settings can be displayed on the form in a special table and can be caused by the "Settings" button and from the "All Actions" menu.
Custom settings connected With the data parameters and selections, some complex way is quite difficult, this connection can be configured visually, but it is somehow uncomfortable to work with them.
Have not yet found anything better how to set the values \u200b\u200bof the existing collection by indexThat by itself can drive off when changing the Layout of the CCD in the visual editor.
In addition, if some data setting is custom, then software installation Data Parameters (see) Not enough, the recoverable value of the user setting interrupts the setting of the data parameter. Therefore, there is no point in establishing for such parameters. data parameter, you need to immediately install custom setting.
Convenient location for installing the desired values \u200b\u200b- Event handler "Prialo-propuser-operating server" Extensions of the report form.
& Nasserver Procedure of the PriescargusSerrier (Settings)
If parameters. Period. Dataoconse<> "00010101" Then the settings \u003d report. Supercrower. Settings. The elements. Description \u003d parameters. Period; Ended;
Extrudresses
Using the data source in the form of an object
To use the type data set, you need to pass external source Data Method Initialize the Data Layout Processor object.
ProprietaryShips \u003d Uncertainty;
Complosing machine \u003d new fold-shirt-cleaner complex; Mockkomponovka \u003d folding machine. Fill (schemecomponicidates, folders. Instruments. Involcts, data industry);
ProcessorComponovka \u003d new processor components; ProcessorComponovka.Initialize (MockComples, a new structure ("Data", to be given to the Source System ()), Prosecuting);
A simple example is attached (for the work of the example you need to have reference books "counterparties" and "contracting contracts").
Almost all the parameters available in the print settings dialogs (printer settings, page properties) can be specified directly when forming a tabular document.
Consider the properties and methods of a tabular document related to the print settings (in the examples of the "TABD", this is a "tabular document" object).
Property "NamePrinter" Allows you to set a printer for printing, different from the default installed. The name must match the printer name specified in the system:
TABDD.MIPRERTER \u003d "CANON IR1133";
When printing a package of documents, you can save time by setting a sign of parsing over copies:
Tabdow .Revelopment \u003d truth;
The number of copies can be specified as follows:
Tauffard. Nality Industries \u003d 5;
Of course, you can set fields:
Tabdok.Polevleva \u003d 20; // Field on the left 20mm, other fields 10mm (default)
A few more property properties:
Tabdown. OrientationStrica \u003d Orientation Force. Decishaft; Tabdown. EnexpilerStranice \u003d 2; // on the sheet will be placed 2 paps of the Tauffa. Automastea \u003d Truth; // Similar to the scale settings "by the width of the page"
If necessary, you can specify a specific scaling value in percent (property "Scale").
Property "Distributor" Allows you to set standard page formats - "A3", "A4", "A5" ( full list Options are available in Help 1C).
Tauffard. Size \u003d "A3"; // Letter A should be English
For non-standard size Paper (Custom) You can specify the values \u200b\u200bof the height and width of the page (in mm):
Also in the tabular document is available to control the columns and their content. For this serve as properties "Page header" and "Footer". For example:
Tabdow. Vervelovkolontitul. Highly \u003d truth; // The top footer will be printed. The sizzyolontitules upstairs \u003d 7; // Size 2mm column (default 10mm) Tabdow. Verkhnytolontitul. Vertical unit \u003d Vertical Position. Top; Tabdow. Vervelovyolontitul. Protector \u003d 2; // The footer is displayed from the second page of the fontscolontulu \u003d new font ("Courier New", 8, truth); Tabdow. Vervelovkolontitul. Shift \u003d Skolontitu; // Inclined Tabdock Font. Vervelovkolontitul. Textreter \u003d "Upper footer"; Tabdow. VervelTechnotytul. Texture \u003d "Page [& the number] from [& Packing]"; // Numbering Pages of Tabdow. Vervelovkontitul.TextSleva \u003d "[& Date]"; // Current Date
The formed document is sent to print using the method "Type()". Perhaps two call options.
1) directly to the printer:
Tabdow.Nap (mode of useDialogaping. Do not use); Tabdow.Nach (truth);
2) Printing dialog will be displayed before printing:
TABOTS.NEPRIPTICS Tabdow.Nach (lie);
In addition, you can manage and split the document on the page. Rate the number of pages in the document on the settings of the current printer can be:
Tabdon.Colticsproof ();
Using methods "Checking ()" and "Check-off ()" can be determined if it fits tabular document Or an array of table document areas on a height page and wide at the current printer settings.
It should be borne in mind that the work of the last three methods depends on installed printer. If the method fails to find it, an exception is caused.
Forced to insert page breaks allow methods "Suiterical separator ()" and "Featuresigorizantal separator ()".
Thus, you can control the page printing and control the filling of the page:
If it is not a TABDD. Equipment (arrays of the library) Then a TABOTS. HighnessGorizontal separator (); Following
An important characteristic of the "1C: Enterprise 8.2" platform is strictly separated by properties and methods in the context of execution. If all of the above properties are available in any context, then the listed methods are not available on the fine client. Exception is the "Print ()" method, the availability of which for obvious reasons is limited client part. This means that the formation of a tabular document should occur on the server, and send it to print in the client procedure.
Today we will consider the decision of an interesting task - conclusion of pictures in the report.
What can it be useful for?
Here a few examples:
Price list with pictures of goods and logo in the header
Profiles of staff with photos
Record of settlements with printing and signature in the basement
Reports / Print Scroll Forces
In the video we also disassemble software formation Report on the CCD. This method of reporting is used in typical configurations - This is another reason to watch it carefully :)
Predefined layouts in LCD
Using predefined layouts, you can override the standard registration of the report.
In this lesson, in addition to setting the task, consider:
To solve the task of outputting images to the report on the CCD, it is necessary to form it programmatically.
It is when the report programming is it possible to refer to binary data.
During this lesson, we will perform:
Displays the result of the layout in a tabular document
Using the object PrognitionShiphrovka
Get binary data from the base
Software creation of drawings in a tabular document
Display Pictures in the CCD report
In this lesson, we perform final actions: the previously obtained binary data is displayed in the report.
To do this, the drawing is added to the table document, after which it is displayed in the report.
Universality of the algorithm for the output of pictures
The developed image output algorithm is universal - with any change in the report structure, the algorithm continues to work.
Actually, we will prove in this lesson.
In addition, consider the feature of the background formation of the report on the CCC (the construction of the report with the help of regulatory tasks).
Image output in the report header
Often in the header or basement of the report you need to withdraw a static picture.
It would seem a simple task, but in the case of the CCD you need to know how to solve it:
Step 1. Software We form a report
Step 2. Create a separate layout with the desired cap or basement
Step 3. Before filling cC report Display a section with the necessary data.
In this video, the solution is clearly shown.
Happy viewing! :)
For the past few days, we publish materials on the CCD.
And what if the programmer / introduced 1C does not know the SCD? Maybe it's really not so important?
OK, let's look at what will wait for a specialist who writes reports "on the knee" (for example, using a manual output to a tabular document).
Do not shoot a pianist, he plays, as he can.
Reports practically in all typical configurations Based on the CCD.
For a specialist without knowledge of the CCD, the reference of typical reports becomes a lottery - why and how this or that figure is displayed in the report, how to add new sources, where in the code edit the calculated numbers ...
CCD - Report Standard In typical configurations, and 1c does not write comments in the calculation of those who have not yet studied standards :)
A bunch of time to hell ...
Without CCD, reporting is performed in many ways manually.
It is, of course, cool - go out like a Rambo with a screwdriver in your teeth and make everyone :)
As a result - large labor costs for the development of the report and debugging. And any head / customer it will be at least alarming: "Strange, and he is accurate for sure ??"
And if it comes to subsequent refinement of the report, it often becomes a headache (especially if this is someone else's report) ...
Educational trips to customers to change the grouping in the report
CCD allows you to receive quality reports without programming. The backbone is done in a few minutes, Further - bows.
And users can put hold of such reports without attracting programmer, generate several view options - charts, graphs, lists, tables.
Achieve such versatility in reports built programmatically impossible in a reasonable time.
Therefore, the call, the tram, went ... This is such a professional growth for 1C-Nick ...
"You do not have the same, but with pearl buttons? - Unfortunately - no ... "(c)
And if some data should be obtained from another system - from another base 1c or not at all out of 1C?
Using the CCD, you can create a report that works with the current IB data and receives data from another source - programming for this will not need.
Without SKD external The data will be programmatically and not the most trivial way.
If you want to professionally masterk And daily apply in their work, sign up for the course:
Support - 2 months. Course volume - 34 school hours.