Contacts

1C CCD calculated fields for grouping. Functions of the language of expressions of the data layout system. Functions of common modules

Data layout diagram (1C CCD) - Comfortable designer to create in software products 1C: Enterprise of complex reports to promote the development and tracking of automation of production, allowing them to make them as flexible and beautiful in a minimum of time. Additional plus data layout circuits (1C CCD) - automatic formation of a managed report form, and with further development of this direction, is an important factor when choosing a report to develop a report. But due to the complexity of the structure of the data layout scheme (1C CCD) and huge number Settings often leads to longer reporting than through the "output form designer". Therefore, the 1C programmer needs to be understood in all the intricacies of the operation of the data layout scheme (1C CCD) in order to further speed up the development time of the reporting.

We will analyze the first three tabs of the data layout circuit (1C CCD) - a set of data, data set links and calculated fields.

Data set in 1C CCD

Data set includes the possibility creating three Objects - request, object and union, let's stop in more detail on each of them:

It is a normal query that is formed by the request designer button. If the Auto Filling flag is set, then all selected details will automatically fall into the data set fields. It is also possible to configure the filling of fields in the query on the Data Layout tab, where there are three tabs:

Tables, there are tables that will participate in the formation of the report, the default data is usually selected, since on the table and fields tab, we have already chosen documents we need, reference books, registers ...

Fields, here we choose those objects that should fall into the report, the Flag of the child indicates whether the affordable daughter elements will be available via the object or not, it is logical that string, numeric and such data will not be installed the flag to the truth position.

Conditions here we choose those objects that can be used under conditions in the CCD.

Part of the work is performed in the data layout scheme, part programmatically, consider on a simple example:

First create a layout of the layout diagram of the document from the document and call the CCD (for example: 1C CCD), we create a set of data object, then fill the fields, for example, have from a document table part Products with details - Nomenclature, quantity and price.

Add three fields and fill in each column the field name of the details, the remaining columns will be filled automatically:

Create a button on the form of a document, describe the mechanism of work in managed formas:

& Svalette

Printing procedure ()

Intive \u003d printing server (); // Call the function on the server

Intove. Sink (); // Display formed Report

Extrudresses

&On server

Function printing server ()

Object Coverage \u003d RequisitformAnd ("Object");

//we put the table part in the structure with the name of the goods supplied in the same way as we pointed out in the SCD itself the name of an object containing data

Sety \u003d new structure;

Setdown. Hold ("supplied", objects.

//we get our layout and set the default settings so that all the report output settings have taken from our layout.

Nashmaket \u003d Object Course. Pouring Macket ("SCD");

Settings \u003d Nashmaquket.Anstroykipoomole;

//create a layout layout of data with our settings.

Complosing machine \u003d new fold-shirt-cleaner complex;

MocktackComponovka \u003d folder machine. Fill (Nashmaquket, settings);

//we carry out the layout of data with our data set

ProcessorComponovydanny \u003d new processorCompon's

ProcessorComponovydny.Initialize (layout committees, set);

//forming tabular document and bring our report to it

Document account \u003d new tabular document document;

Processor Equipment \u003d New processor-in-line results CommonTheldBlocks

Processor Equipment

Processor Equipment. Equip (processorCompon);

Refund of the document accounting;

Endfunction

If you wish, you can get areas and any other layout and also to withdraw in this report, for example, we have a typical layout of the formation of payments and a hat created in it very well, then that we will not make an extra work, just first get the layout, bring the cap, Then I will form and give our report on the CCD.

ABOUT baptist

In it, we can place our requests and objects, but in contrast to the connection, it simply adds tables to each other, that is, if we connect two identical tables, we will result in one, and when combined, it will double, consider on a simple example :

We have tables:

When communicating, we will get:

And when combined:

Consider now filling the columns in data sets (some miss, as they are associated with other tabs, back to them in future articles):

- field, indicate the general name of the requisite;

­­- way, indicate the name of the requisite, according to which we will contact it in the CCD, for example, in Calculated fields;

- title, indicate the name of the details that will be displayed in the report;

- field restriction, indicate the availability of this props;

- Restriction of requisites, specify accessibility daughter elements, it is important if the availability of details is indicated, the field itself will be available, perhaps in future releases will change this mechanics;

- the expression on which the field representation is calculated, it is convenient to use when we need to change the conclusion of the details, for example, we need to after the name nomenclature Output warehouseOn which it is located, then fill in the following: the nomenclature + "is in stock" + warehouse. I repeat that circulation details is carried out through the name specified in the column way;

- streaming expression, a convenient mechanism for setting up a reporting report, where the condition can be set manually, similar to the previous point, but as practice shows, this mechanism does not work as much as I would like, and I advise you to use standard sorting;

- type of value, the type of props value is specified, it is necessary to fill out if you enjoy the following field;

- available values , works only when filled type value, open the filling form in the column Value We indicate the element to be changed according to the type, it can be predefined objects or in numeric, for example, details are simple values, in representation We indicate what we need to change, an example of Boolean type:

- registration - Standard setup of the field format, similar to the configuration in the controlled forms, allows you to more accurately and beautifully configure the output of a specific props.

Communication dataset in 1C CCD

Here is installed only left connection, according to the principle similar to ties In queries, in communication source Indicate the main table for the connection in receiver Additional. IN expression Sourceand expression receiver We indicate the details on which communication will occur. The remaining columns will look more in more detail when we disassemble the tab Parameters. If not additional connection With parameters, it is recommended to communicate in the query, it will speed up the work of the report.

In the next exit 8.2.14, I will try to describe some new features of the data layout system.

Open the data layout circuit, preferably in the external report so that it is easier to edit.

Add a set of type data type and write, or manually, either using the query constructor the simplest query:

1. Configure the request to the LCD.

2. Customize the calculated fields in the CD

3. Perform the data layout setting on the Settings tab

4. Run 1C enterprise 8.2.14. Open a report. We form, we get.

Description of the new features themselves:

1. The current date()

Returns the system date. When laying a layout layout in all expressions that are present in the layout, the flow function () is replaced by the value of the current date.

2. Calculate system ()

Syntax:

Calculating expectation (<Выражение>, <Группировка>, <ОбластьВычисления>, <Начало>, <Конец>, <Сортировка>, <ИерархическаяСортировка>, <ОбработкаОдинаковыхЗначенийПорядка>)

Description:

The function is designed to calculate the expression in the context of some grouping.

The function takes into account the selection of groupings, but does not take into account hierarchical selections.

The function cannot be applied to the grouping in the group selection of this grouping. For example, in the selection of grouping, the nomenclature cannot be used by the expression of the calculation of the expectation ("sum (total-loop)", "generality")\u003e 1000. But such an expression can be used in a hierarchical selection.

If the final record is preceded by the initial, it is believed that the records for calculating the detailed data and the calculation of aggregate functions are absent.

When calculating the interval expressions for a common result (the grouping parameter matters a common value) it is believed that there are no records for calculating the detailed data and the calculation of aggregate functions.

The layout linker when generating an expression of the calculating function, if the ordering expression contains fields that cannot be used in grouping, replaces the function of calculating the expectation on NULL.

Parameters

<Выражение>

Type: Row. The expression that must be calculated.

<Группировка>

Type: Row. Contains the name of the group, in the context of which it is necessary to calculate the expression. If an empty string is used as a group name, the calculation will be executed in the context of the current grouping. In the event that a number of common groups will be used as a group of grouping, the calculation will be executed in the context of a total result. In other cases, the calculation will be performed in the context of the parent group with the same name.

For example:

Amount (sales. Masmoboto) / Calculate ("Amount (Sales. Summary)", "Obnutogit")

IN this example As a result, the ratio of the amount of the sale field is obtained. The memory of the group entry to the sum of the same field in the entire layout;

<ОбластьВычисления>

Type: Row. The parameter can take the following values:

  • Cold - the expression will be calculated for all grouping records.
  • Hierarchy - the expression will be calculated for the parent hierarchical record, if any, and for the whole grouping, if the parent hierarchical record is not available.
  • Grouping - the expression will be calculated for the current group entry grouping.
  • Grouping Series - When calculating a function for group recording for resources, the expression will be calculated for the first group entry of the original grouping.

When calculating the function Calculate system () with the value of the grouping router for group entriesWith the resource facilities, the function is calculated in the same way as it was calculated if the parameter value was equal to the grouping value.

Data layout layout layout when generating a layout of data layout when displaying a field-resource layout, which is performed by a grouping, places an expression on the layout calculated using a function Calculate system (), indicating the parameter magrorization router. For other resources, ordinary resource expressions are placed in the resource grouping.

<Начало>

Type: Row. Indicates which record you need to start a fragment in which to calculate the aggregate functions of the expression and from which record to receive field values \u200b\u200boutside the aggregate functions. The value may be one of the following:

<Конец>

Type: Row. Indicates, to which record you need to continue a fragment in which to calculate the aggregate expression functions. The value may be one of the following:

  • First (first). You must receive the first group entry. After the word in brackets, you can specify the expression whose result will be used as a shift from the beginning of the group. The value obtained should be integer to be a number, more zero. For example, the first (3) - receiving the third entry from the beginning of the grouping.

If the first record goes beyond the grouping, it is believed that there are no records. For example, if the records 3, and it is required to recover (4), it is believed that there are no records.

  • Last (Last). You need to get the latest entry of the grouping. After the word in brackets, you can specify the expression whose result will be used as a shift from the end of the grouping. The value obtained should be integer to be a number, more zero. For example, the last (3) is to receive a third entry from the end of the grouping.

If the last record goes beyond the grouping, it is believed that there are no records. For example, if records 3, and it is required to get a last (4), it is considered that there are no records.

  • Previous (Previous). You need to get the previous grouping record. After the word in brackets, you can specify the expression whose result will be used as an offset back from the current grouping entry. For example, the previous one (2) is obtaining the previous one from the previous record.

If the previous entry goes beyond the grouping (for example, for the second group entry, you need to get the previous one (3), then the first group is obtained.

Upon receipt of the previous recording, the first entry is considered for the group.

  • Next (Next). You need to get the following grouping. After the word in brackets, you can specify the expression whose result will be used as a shift forward from the current grouping entry. For example, the following (2) is obtaining the following from the next entry.

If the next entry goes beyond the grouping, it is believed that there are no records. For example, if the records 3 and for the third record are obtained as follows (), it is considered that there are no records.

Upon receipt of the next record for the summary of the grouping it is believed that there are no records.

  • Current. You need to get the current entry.

Upon receipt for the sum of grouping, the first record is obtained.

  • Restricted (boundaryvalue). Need to get a record at the specified value. After the word restricted brackets, you need to specify the expression, with the value of which you need to start a fragment, the first ordering field.

The first record will be received as an entry, the ordering field value in which is greater than or equal to the specified value. For example, if a period field is used as a field of ordering, and it matters 01/01/2010, 01.02.2010, 01.03.2010, and it is required to obtain limitance (datarier (2010, 1, 15)), then a record with date 01.02 will be received. 2010.

<Сортировка>

Type: Row. Expressions are listed, separated by commas, which describe the ordering. If not specified, the ordering is performed as well as in the grouping for which the expression is calculated. After each expression, you can specify keyword ABS (for ordering ascending), descending (for ordering in descending) and auto-order (to organize references on the fields for which you need to organize the object to which the link is performed). The word auto-order can be used both with the word ABS, and with the word descending.

<ИерархическаяСортировка>

Type: Row. Similar to the Sort parameter. It is used to streamline hierarchical records. Unless specified, the layout layout generates an ordering in accordance with the ordering specified in the Sorting parameter.

<ОбработкаОдинаковыхЗначенийПорядка>

Type: Row. Indicates the definition rule of the previous or the next entry in case there are several entries with the same ordering value:

  • Separately (Separately) indicates that the sequence of ordered records is used to define the previous and next records. The default value.
  • Together (TOGETHER) denotes that the previous and the following entries are determined based on the values \u200b\u200bof the arrangement of arrangement.

For example, if the resulting sequence is ordered by date:

date Full name Value
1 January 01, 2001 Ivanov M. 10
2 January 02, 2001 Petrov S. 20
3 January 03, 2001 Sidorov R. 30
4 January 4, 2001 Petrov S. 40

If the value of the parameter is separate, then:

§ Previous recording to write 3 will be recording 2.

§ If the calculated fragment is defined as the current, current (respectively, the start and end parameters), then for recording 2, this fragment will consist of one record 2. Expression of the calculating system ("sum (value)", the current, current) will be 20.

If the parameter value is equal to together, then:

§ Previous recording to recording 3 will be record 1.

§ If the calculated fragment is defined as the current, current (respectively, the start and end parameters), then for recording 2, this fragment will consist of recording 2 and 3. Expression of the calculating system ("sum (value)", the current, current) will be 50.

When you specify the value of the parameter equal to together, the start and end parameters can not specify the offset for the position of the first, the last one, the previous one.

Calculating Execution ("Amount (Size Layer)", "First", "Current")

If you want to get a grouping value in the previous line, you can use the following expression:

Computing Execution ("Course", "Previous")

List new Functions:

Calculate WasteReisibrouproupsOmassive(<Выражение>, <ВыражениеПолейГруппировки>, <ОтборЗаписей>, <ОтборГруппировок>) –

The function returns an array, each element of which contains the result of calculating the expression for grouping by the specified field.

Calculating / separationGroupsCountries(<Выражения>, <ВыражениеПолейГруппировки>, <ОтборЗаписей>, <ОтборГруппировок>) –

The function returns the table of values, each line of which contains the result of calculating expressions for grouping by the specified field

The value is filled(<Выражение>) - returns truth if the value is different from the value this type By default, it is excellent from the value ofNull, excellent from an empty link, is different from the value. For logical values, an NULL value is checked. For strings, checks on the absence of not space characters

Format(<Выражение>, <Форматная строка>) - Get the formatted string of the transmitted value. The format string is set in accordance with format string Systems "1C: Enterprise".

Substring(<Выражение>, <Начальные символ>, <ДлинаПодстроки>) – This feature Designed to highlight a substring from the string.

Flat stroke(<Выражение>) - The function is designed to determine the length of the string. Parameter - String Expression

Line(<Выражение>) - if an array is transmitted as a parameter, then the function returns a string containing string representations of all array elements separated by symbols "; ". If the value table is transmitted as a parameter, then the function returns a string containing the string views of all rows of the values \u200b\u200bof the values, and the appendix of the cells of each line is separated by symbols "; ", And the lines are the communion of the translation line. If a string representation is empty, then a string is displayed instead of its presentation<Пустое значение>.

Language of expressions of the data layout system

The data layout expressions language expressions are designed to record expressions used in different parts of the system.

Expressions are used in the following subsystems:

  • data layout diagram - to describe the calculated fields, results of results, communication expressions, etc.;
  • data layout settings - To describe user field expressions;
  • data layout layout - to describe the communication set expressions, describing the parameters of the layout, etc.

Literal

The expression may have literals. The following types are possible:

  • Line;
  • Number;
  • Date;
  • Booleo.

Line

The string literal is written in the characters "", for example:

"Stroke literal"

If you need to use inside the string literal of the "" symbol, two such characters should be used.

For example:

"Literal" "in quotes" ""

Number

The number is written without spaces, in decimal format. Fractional part Completed using the symbol ".". For example:

10.5 200

date

Date type literal is written using a dattime key literal. After this keyword, in brackets, a year, month, day, hours, minutes, seconds are listed through commas. An indication of time is not necessary.

For example:

Datastern (1975, 1, 06) - Sixth January 1975 Datastern (2006, 12, 2, 23, 56, 57) - second December 2006, 23 hours 56 minutes 57 seconds, 23 hours 56 minutes 57 seconds

Boolean

Boolean values \u200b\u200bcan be recorded using truth literals (TRUE), Lies (FALSE).

Value

To specify the literals of other types (system enumerations, predefined data), a key word is used, after which the literal name is indicated in brackets.

Meaning (VIDCET. Active)

Operations on numbers

Unary -

This operation is designed to change the sign of the number to the opposite. For example:

Sales. Nationality

Unary +.

This operation does not perform any actions above the number. For example:

Sales. Nationality

Binary -

This operation is designed to calculate the difference in two numbers. For example:

Residual feuds. Proprietary resistant - residuals. Concentrate residual residues. Protective, 100 400 - 357

Binary +.

This operation is intended to calculate the sum of two numbers. For example:

Residual feuds. Proprietary + residual feuds. Turnover residibles. Protecting. + 100 400 + 357

Composition

This operation is designed to calculate the work of two numbers. For example:

Nomenclature. Price * 1.2 2 * 3.14

Division

This operation is designed to obtain the result of dividing one operand to another. For example:

Nomenclature. Price / 1.2 2 / 3.14

Remainder of the division

This operation is designed to obtain a balance from dividing one operand to another. For example:

Nomenclature. Price% 1.2 2% 3.14

Operations on strings

Concatenation (binary +)

This operation is designed to concatenate two lines. For example:

Nomenclature.Article + ":" + Nomenclature. Name

Like

This operation checks the correspondence of the string transmitted pattern.

The valid of the operator is true if the value is<Выражения> Satisfies the template, and false otherwise.

The following characters B.<Строке_шаблона> make sense, different from simply another string symbol:

  • % - percentage: a sequence containing zero and more arbitrary characters;
  • _ - underscore: one arbitrary symbol;
  • [...] - one or more characters in square brackets: one character, any of the listed in square brackets. The lists may occur the ranges, for example A-Z, meaning an arbitrary symbol included in the range, including the ends of the range;
  • [^ ...] - In square brackets, the denial icon, followed by one or more characters: any character, except those listed in the negative icon;

Any other character means itself and does not carry any additional load. If one of the listed characters should be written as itself, then he must precede<Спецсимвол>, Specified after the keyword Special Milk (Escape).

For example, template

"% ABB [ABBG] \\ _ ABV%" Specialsimol "\\"

means a substring consisting of a sequence of symbols: letters A; letters b; letters in; one digit; one of the letters a, b, in or g; Stress symbol; Letters A; letters b; letters in. Moreover, this sequence can be located starting from an arbitrary position in the string.

Operations of comparison

Equally

This operation is intended to compare two operands per equality. For example:

Sales. Contrgent \u003d Sales. Nomelaclatura-binding

Not equal

This operation is designed to compare two operands for inequality. For example:

Sales. Kontragent<> Sales. Nomelaclatura-binding

Less

This operation is designed to verify that the first operand is less than the second. For example:

Surgious< ПродажиПрошлые.Сумма

More

This operation is designed to verify that the first operand is greater than the second. For example:

Surgious. Summum\u003e Said. Summum

Less or equal

This operation is designed to verify that the first operand is less or equal to the second. For example:

Surgious<= ПродажиПрошлые.Сумма

More or equal

This operation is designed to verify that the first operand is more or equal to the second. For example:

For sale. Masm: \u003d Said. Summary

Operation B.

This operation checks the availability of the value in the transmitted list of values. The result of the operation will be true, in case the value is found, or false - otherwise. For example:

Nomenclature in (& product11, & product2)

Operation check availability in the data set

The operation checks the availability of the value in the specified data set. Data set to check should contain one field. For example:

Sales. Contrgent in counterparties

Value check operation on NULL

This operation returns the value of truth if the value is the value of NULL. For example:

Sales. The progengerant is NULL

Operation verification value for NULL inequality

This operation returns the value of the truth in case the value is not the value of NULL. For example:

Selling. The control agent is not NULL

Logical operations

Logical operations are taken as an expression operands having a type of Boolevo.

Operation ne.

The operation does not return the value of the truth if its operand is set to false, and the value is false if its operand is of the value of truth. For example:

NOT DOCUMENT. Fragment of the program. Document.

Operation I.

Operation and returns the value of the truth if both operands are of the value of the truth, and the value is false if one of the operands matters a lie. For example:

Document. Framed document \u003d Document. Underwriter and Document. Contractor \u003d & Contract

Operation or

Operation or returns the value of truth if one of the operands is the value of truth, and a lie in case both operands are valid. For example:

Document. Framed \u003d Document. A loader or document. Fragmentist \u003d & counterpart

Aggregate functions

The aggregate functions carry out some action above the data set.

Sum

The aggregate function amount calculates the amount of values \u200b\u200bof expressions transmitted to it as an argument for all detailed records. For example:

Amount (Sales. Summary)

number

The function number calculates the number of values \u200b\u200bother than NULL values. For example:

Quantity (sale. Contrgent)

Number of different

This feature calculates the number of different values. For example:

Quantity (various sales. Control agent)

Maximum

The function gets the maximum value. For example:

Maximum (residues. Nality)

Minimum

The function gets the minimum value. For example:

Minimum (residue. Nality)

Average

The function gets an average value for values \u200b\u200bother than NULL. For example:

Average (residues. Nality)

Other operations

Operation Selection

Operation The selection is intended to select one of several values \u200b\u200bwhen performing certain conditions. For example:

Selection when the sum\u003e 1000 then the sum otherwise 0 end

Rules for comparing two values

If the types of compaable values \u200b\u200bdiffer from each other, the relationship between values \u200b\u200bare determined based on the priority of types:

  • NULL (the lowest);
  • Boolean;
  • Number;
  • Date;
  • Line;
  • Reference types

Relations between different reference types are determined on the basis of reference numbers of tables corresponding to this or another type.

If the data types are the same, the values \u200b\u200bare compared to the following rules:

  • at the boolean type, the value of the truth is greater than the value of false;
  • at the type of type regular rules comparisons for numbers;
  • at the type of earlier dates less than later;
  • at the line type - comparisons of rows in accordance with the established national features Database;
  • reference types are compared based on their values \u200b\u200b(recording numbers, etc.).

Work with NULL

Any operation in which the value of one of the NULL operands will give the NULL result.

There are exceptions:

  • operation and will return NULL only if none of the operands matters a lie;
  • operation or will return NULL only if none of the operands do not matter the truth.

Priorities of operations

Operations have the following priorities (the first line has a lower priority):

  • B, there is NULL, there is not null;
  • =, <>, <=, <, >=, >;
  • Binary +, binary -;
  • *, /, %;
  • Unary +, unary -.

Functions of the language of expressions of the data layout system

Calculate

The Function is intended to calculate the expression in the context of some grouping. The function has the following parameters:

  • Expression. String type. Contains a calculated expression;
  • Grouping. String type. Contains the name of the group, in the context of which it is necessary to calculate the expression. If an empty string is used as a group name, the calculation will be executed in the context of the current grouping. In the event that a number of common groups will be used as a group of grouping, the calculation will be executed in the context of the total result. In other cases, the calculation will be performed in the context of the parent group with the same name. For example:
Amount (sales. Masmoboto) / Calculate ("Amount (Sales. Summary)", "Obnutogit")

In this example, the result is the ratio of the amount of the "Sales. Summary" entry of the grouping to the sum of the same field in the entire layout.

Level

The function is designed to obtain the current recording level.

Level()

Self-order

Get the next sequence number.

Self-order ()

The number is in order

Returns the next sequence number in the current grouping.

Callergling group ()

Format

Get the formatted string of the transmitted value.

The format string is set in accordance with the format line 1C: Enterprise.

Parameters:

  • Value;
  • Format string.

Format (expendable value. Summaging, "CDC \u003d 2")

Beginning of period

Parameters:

    • Minute;
    • Day;
    • A week;
    • Month;
    • Quarter;
    • Decade;
    • Half year.

Starteriod (Datastern (2002, 10, 12, 10, 15, 34), "Month")

Result:

01.10.2002 0:00:00

Ending End

The function is designed to highlight a specific date from a given date.

Parameters:

  • Date. Type date. Specified date;
  • Type of period. String type. Contains one of the values:
    • Minute;
    • Day;
    • A week;
    • Month;
    • Quarter;
    • Decade;
    • Half year.

Ending Extruder (Datastern (2002, 10, 12, 10, 15, 34), "Week")

Result:

13.10.2002 23:59:59

Add space

The function is designed to be added to the date of some size.

Parameters:

  • Type of zoom. String type. Contains one of the values:
    • Minute;
    • Day;
    • A week;
    • Month;
    • Quarter;
    • Decade;
    • Half year.
  • The value is how much you need to increase the date. Type number. The fractional part is ignored.

Add space (Datastern (2002, 10, 12, 10, 15, 34), "Month", 1)

Result:

12.11.2002 10:15:34

DIVISSION

The function is designed to obtain a difference between two dates.

Parameters:

  • Expression. Type date. Source date;
  • Expression. Type date. Submitted date;
  • Type of difference. String type. Contains one of the values:
    • Second;
    • Minute;
    • Day;
    • Month;
    • Quarter;

Distribution (Datastern (2002, 10, 12, 10, 15, 34), Datastern (2002, 10, 14, 9, 18, 06), "Day")

Result:

Substring

This feature is designed to highlight the substring from the line.

Parameters:

  • Line. String type. The string from which is distinguished by a substring;
  • Position. Type number. The position of the symbol from which the substring allocated from the line begins;
  • Length. Type number. The length of the secreted substring.

Substring (counterparties. Press, 1, 4)

Flat stroke

The function is designed to determine the length of the string.

Parameter:

  • Line. String type. Row, the length of which is determined.

String (counterparties. Press)

Year

This feature is designed to highlight the year from the date value.

Parameter:

  • Date. Type date. The date for which the year is determined.

Year (Dat)

Quarter

This feature is intended to highlight the quarter number from the date type value. The quarter number is normal located in the range from 1 to 4.

Parameter

  • Date. Type date. Date on which the quarter is determined
Quarter (Rask'dat)

Month

This feature is intended to highlight the number of the month from the date type value. The number of the month is normally located in the band-zone from 1 to 12.

  • Date. Type date. The date on which the month is determined.
Month (Dat)

Money

This feature is designed to receive the day of the year from the type of date. The day of the year is normal in the range from 1 to 365 (366).

  • Date. Type date. The date for which the day of the year is determined.
Money (Rask Data)

Day

This feature is designed to receive a day of the month from the type of date. The day of the month is normally in the range from 1 to 31.

  • Date. Type date. The date on which is determined by the day of the month.
Day (Dat)

A week

This feature is designed to receive the number of the year of the year from the date type value. The weeks of the year are numbered, starting from 1.

  • Date. Type date. Date on which the number of the week is determined.
Week (RaskAkl. Data)

Doubleded

This feature is designed to receive the day of the week from the type of date. The day of the week is normally in the range from 1 (Monday) to 7 (Sunday).

  • Date. Type date. Date on which the day of the week is determined.
Doubleded (RaskAkl. Data)

Hour

This feature is designed to obtain an hour of day from the type of date. An hour of day is in the range from 0 to 23.

  • Date. Type date. The date for which the hour of day is determined.
Hour (Rask Tat)

Minute

This feature is designed to obtain a minute of an hour from the type of date. A minute of an hour is in the range from 0 to 59.

  • Date. Type date. The date on which is determined by a minute of hours.
Minute (RaskAkl. Data)

Second

This function is designed to get a second minute from the date type value. The second minute is in the range from 0 to 59.

  • Date. Type date. Date on which seconds are defined minutes.
Second (Dat)

Express

This function is designed to highlight the type from an expression that can contain composite type. In case the expression contains a type other than the required type, the value of NULL will be returned.

Parameters:

  • Transformed expression;
  • Note type. String type. Contains type string. For example, "number", "string", etc. In addition to primitive types this line May contain a table name. In this case, an attempt will be made to refer to the link to the specified table.

Express (data. Required1, "Number (10.3)")

Naull

This function returns the value of the second parameter in the case if the value of the first NULL parameter.

Otherwise, the value of the first parameter will be returned.

There isnull (Amount (Sales. Summary), 0)

Functions of common modules

The expression of the data layout mechanism may contain calls for the functions of global common configuration modules. No further syntax for calling such functions is not required.

This example will be called the "Abbreviation" function from the general configuration module.

Note that the use of common module functions is allowed only when specifying the corresponding data layout processor parameter.

In addition, the functions of common modules cannot be used in user field expressions.

In the next exit 8.2.14, I will try to describe some new features of the data layout system.

Open the data layout circuit, preferably in the external report so that it is easier to edit.

Add a set of type data type and write, or manually, either using the query constructor the simplest query:

1. Configure the request to the LCD.

2. Customize the calculated fields in the CD

3. Perform the data layout setting on the Settings tab

4. Run 1C enterprise 8.2.14. Open a report. We form, we get.

Description of the new features themselves:

1. The current date()

Returns the system date. When laying a layout layout in all expressions that are present in the layout, the flow function () is replaced by the value of the current date.

2. Calculate system ()

Syntax:

Calculating Education (,)

Description:

The function is designed to calculate the expression in the context of some grouping.

The function takes into account the selection of groupings, but does not take into account hierarchical selections.

The function cannot be applied to the grouping in the group selection of this grouping. For example, in the selection of grouping, the nomenclature cannot be used expression Calculating Execution ("Amount (Size Layer)", "Obnutitog")\u003e 1000. But such an expression can be used in a hierarchical selection.

If the final record is preceded by the initial, it is believed that the records for calculating the detailed data and the calculation of aggregate functions are absent.

When calculating the interval expressions for a common result (the grouping parameter matters a common value) it is believed that there are no records for calculating the detailed data and the calculation of aggregate functions.

Layout layout when generating function expression Computing ExecutionIn the event that the ordering expression contains fields that cannot be used in grouping, replaces the function Computing Execution on the NULL.

Parameters

A type: Line. The expression that must be calculated.

A type: Line. Contains the name of the group, in the context of which it is necessary to calculate the expression. If an empty string is used as a group name, the calculation will be executed in the context of the current grouping. In the event that a number of common groups will be used as a group of grouping, the calculation will be executed in the context of the total result. In other cases, the calculation will be performed in the context of the parent group with the same name.

For example:

Amount (sales. Masmoboto) / Calculate ("Amount (Sales. Summary)", "Obnutogit")

In this example, the result is the ratio of the amount on the field Sales. Summary recording grouping to the sum of the same field in the whole layout;

A type: Line. The parameter can take the following values:

· The overall result - The expression will be calculated for all grouping records.

· Hierarchy - The expression will be calculated for the parent hierarchical record, if any, and for the whole grouping, if the parent hierarchical record is not available.

· Grouping - The expression will be calculated for the current group recording.

· GroupingResource - When calculating a function for group recording on resources, the expression will be calculated for the first group recording of the original grouping.

When calculating the function Calculate system () with meaning GroupingResource For group entries that are not groups for resources, the function is calculated in the same way as it would be calculated if the parameter value was equal to the value Grouping.

Data layout layout layout when generating a layout of data layout when displaying a field-resource layout, which is performed by a grouping, places an expression on the layout calculated using a function Calculate system () , indicating the parameter GroupingResource. For other resources, ordinary resource expressions are placed in the resource grouping.

A type: Line. Indicates which record you need to start a fragment in which to calculate the aggregate functions of the expression and from which record to receive field values \u200b\u200boutside the aggregate functions. The value may be one of the following:

· First (FIRST)

· Last (Last)

· Previous (Previous)

· Next

· Current (Current)

· Restricted (BoundaryValue) Restricted

A type: Line. Indicates, to which record you need to continue a fragment in which to calculate the aggregate expression functions. The value may be one of the following:

· First (FIRST). You must receive the first group entry. After the word in brackets, you can specify the expression whose result will be used as a shift from the beginning of the group. The value obtained should be integer to be a number, more zero. For example, the first (3) - receiving the third entry from the beginning of the grouping.

If the first record goes beyond the grouping, it is believed that there are no records. For example, if the records 3, and it is required to get the first (4), it is believed that there are no records.

· Last (Last). You need to get the latest entry of the grouping. After the word in brackets, you can specify the expression whose result will be used as a shift from the end of the grouping. The value obtained should be integer to be a number, more zero. For example, the last (3) is to receive a third entry from the end of the grouping.

If the last record goes beyond the grouping, it is believed that there are no records. For example, if records 3, and it is required to get the last (4), it is believed that there are no records.

· Previous (Previous). You need to get the previous grouping record. After the word in brackets, you can specify the expression whose result will be used as an offset back from the current grouping entry. For example, the previous one (2) is obtaining the previous one from the previous record.

If the previous entry goes beyond the grouping (for example, for the second group entry, you need to get the previous one (3), then the first group is obtained.

Upon receipt of the previous recording, the first entry is considered for the group.

· Next. You need to get the following grouping. After the word in brackets, you can specify the expression whose result will be used as a shift forward from the current grouping entry. For example, the following (2) is obtaining the following from the next entry.

If the next entry goes beyond the grouping, it is believed that there are no records. For example, if the records 3 and for the third record are obtained as follows (), it is considered that there are no records.

Upon receipt of the next record for the summary of the grouping it is believed that there are no records.

· Current (Current). You need to get the current entry.

Upon receipt for the sum of grouping, the first record is obtained.

· Restricted (BoundaryValue). Need to get a record at the specified value. After the word Restricted In brackets you need to specify the expression, with the value of which you need to start a fragment, the first ordering field.

The first record will be received as an entry, the ordering field value in which is greater than or equal to the specified value. For example, if the field is used as a field of ordering, and it matters 01/01/2010, 01.02.2010, 01.03.2010, and you need to get Restricted (DATEVERY (2010, 1, 15)), I will receive a record with the date 01.02.2010.

A type: Line. Expressions are listed, separated by commas, which describe the ordering. If not specified, the ordering is performed as well as in the grouping for which the expression is calculated. After each expression, you can specify a keyword CZ (for ordering ascending), Descending (for ordering in descending) and Auto-order (To streamline references in the fields for which you need to organize an object to which the link is performed). Word Auto-order can be used as with the word CZand with the word Descending.

A type: Line. Similar to the parameter Sorting. It is used to streamline hierarchical records. Unless not specified, the layout layout generates an ordering in accordance with the ordering specified in the parameter Sorting.

A type: Line. Indicates the definition rule of the previous or the next entry in case there are several entries with the same ordering value:

· Separately (separately) Indicates that to determine the previous and next records, the sequence of ordered records is used. The default value.

· Together (TOGETHER) Indicates that the previous and the following entries are determined based on the values \u200b\u200bof arrange expressions.

For example, if the resulting sequence is ordered by date:

date Full name Value
1 January 01, 2001

Ivanov M.

10
2 January 02, 2001 Petrov S. 20
3 January 03, 2001 Sidorov R. 30
4 January 4, 2001 Petrov S. 40

Separately, then:

§ Previous recording to write 3 will be recording 2.

Current, current (respectively, parameters Start and the end), then for recording 2, this fragment will consist of one record 2. The expression will be equal to 20.

If the value of the parameter is equal Together, then:

§ Previous recording to recording 3 will be record 1.

§ if the calculated fragment is defined as Current, current (respectively, parameters Start and the end), then for recording 2, this fragment will consist of recording 2 and 3. Expression Calculating expectation ("Amount (value)", current, current) It will be 50.

When specifying the value of the equal parameter Together, in parameters Start and the end You can not specify the offset for positions First, last, previous, next.

Calculating Execution ("Amount (Size Layer)", "First", "Current")

If you want to get a grouping value in the previous line, you can use the following expression:

Computing Execution ("Course", "Previous")

List new Functions:

Calculate WasteReisibrouproupsOmassive(,) -

The function returns an array, each element of which contains the result of calculating the expression for grouping by the specified field.

Calculating / separationGroupsCountries(,) -

The function returns the table of values, each line of which contains the result of calculating expressions for grouping by the specified field

The value is filled() - Returns truth if the value is different from the value of this type by default, is different from the value of NULL, excellent from the empty link, is different from the value. For logical values, an NULL value is checked. For strings, checks on the absence of not space characters

Format(,) - Get the formatted string of the transmitted value. The format string is set in accordance with the format string of the "1C: Enterprise" system.

Substring(,,) - This function is designed to highlight the substring from the row.

Flat stroke() - The function is designed to determine the length of the string. Parameter - String Expression

Line() - If an array is transmitted as a parameter, then the function returns a string containing string representations of all array elements separated by symbols ";". If the value table is transmitted as a parameter, then the function returns a string containing the string representations of all rows of the values \u200b\u200bof the values, and the samples of each string are separated by symbols ";", and the strings - the limit of the row translation. If a string representation is empty in any element, the string is displayed instead of its presentation.

We looked at the settings of the reports implemented on the basis of the SCD. Now we will analyze more subtle and detailed settings Report options. The "Advanced" window of the report option settings is called by the "More" command - "Other" - "Change Report Option".

The change window of the report option is divided into two parts:

1. Report structure.

2. Report settings.


The section of the report version structure is similar to the Structure tab of the standard report settings. Assignment and configuration of groups is considered in detail in Part 1 of Articles.

Table of the status of a report option, except directly columns with groups, contains several additional columns:

The report settings section of the report option gives the user wide opportunities By configuring the report under your needs. It almost completely coincides with standard settings The report discussed in part 1. Consider all the tabs of the section and note the differences.

The settings section consists of the following tabs:

1. Parameters. Contains the parameters of the CCD accessible to the user.

The CCC parameter is a slight value used to obtain a report data. It can be a value of the condition for selecting or checking data, as well as an auxiliary value.


The parameter table is presented in the "Parameter" format - "value". If necessary, you can change the values \u200b\u200bof the parameters. Pressing the "Custom Settings Item Properties" button opens up user element settings.


In this window, you can choose whether the item will be enabled in user settings (i.e., the user is visible when setting up a report), set the element representation and editing mode ( fast access In the report header, the usual report and inaccessible settings).

The properties of the user settings element also have grouped fields, fields, selections and conditional design elements.

2. Custom fields. Contains the fields that the user itself is formed on the basis of the data selected by the report.


The user can add two types of fields:

  • New field choice ...
  • New field expression ...

Selection fields allow you to calculate the value by given condition. The selection field editing window contains a header field and a table in which the selection, value and representation of the field are specified. The selection is a condition, depending on which the desired value will be substituted.


For example, we calculate the assessment of the number of sales. We will assume that if less than 10 units of goods sold, they sold little, and if more than 10 units are a lot. To do this, set 2 the values \u200b\u200bof the calculated field: the first will be with the selection "The amount of goods is less than or equal to" 10 "", the second with the selection "The amount of goods is larger than" 10 ".

Expression fields allow calculating the value using arbitrary algorithms. They can use the functions of the query language and the built-in programming language 1c. The expression field editing window contains two fields for expressions of detailed and final entries. The final entries are groupings configured in the "Report Structure" area, they need to use aggregate functions ("sum", "minimum", "maximum", "quantity").

For example, we calculate the average percentage of the discount. The average percentage of the discount is calculated by the formula: [Sales amount without a discount] - [Sales amount with a discount] / [Sales amount without a discount]. It must be remembered that the sales amount without a discount can be zero, so we use the selection operator to check. We obtain the following expressions:

· For detailed records:

Choice

When [Sales Amount without Discount] \u003d 0

Then 0

Otherwise [Sales amount without a discount] - [Sales amount with discount] / [Sales amount without a discount]

the end

· For final entries:

Choice

When the amount ([Sales amount without a discount]) \u003d 0

Then 0

Otherwise, the amount ([Sales amount without a discount]) - Amount ([Sales amount with a discount]) / Amount ([Sales amount without discount])

the end

As mentioned earlier, in the expression of the final entries we use aggregate function "Amount."

3. Grinded fields. Contains the fields by which the result of the report option will be grown. Grinding fields are configured separately for each of the groups, but you can set common grouping fields for the report option, if you select the root of the "Report" in the structure. You can add a field from the report result, a user field or select the auto field, then the system will select the field automatically. Also, this tab allows you to change the procedure for grouping fields.


4. Fields. Contains fields that will be displayed in the result of the report option. Fields are configured separately for each of the groups, but you can set common fields for the report option if you select the "Report" root structure in the structure. You can add a field from the report result, a user field or select the auto field, then the system will select the field automatically. Also, this tab allows you to change the order of fields.

Fields can be grouped to logically select any part of the report or set a special arrangement of columns. When adding a group, the "Location" column becomes active and allows you to select one of the location options:

  • Auto - the system has fields automatically;
  • Horizontally - fields are horizontally;
  • Vertically - fields are located vertically;
  • In a separate column - fields are located in different columns;
  • Together - fields are located in one column.


5. Selection. Contains the selections used in the report version. Setting up the selections was considered in detail in part 1 of this article. Selects are configured separately for each of the groups, but you can set general selection for the report option, if you select the "Report" root structure in the structure.


6. Sort. Contains the sorting fields used in the report version. Setting up the sorting fields was considered in detail in terms of this article. Sorting is configured separately for each of the groups, but you can set common sorting fields for the report option, if you select the "Report" root structure in the structure.


7. Conditional design. Contains the conditional design elements used in the report version. Conditional registration was considered in detail in terms of this article. Conditional design is configured separately for each of the groups, but you can specify common conditional design elements for the report option, if you select the root of the "Report" in the structure.


8. Advanced settings. Contains additional settings Report decoration. Allow you to choose common appearance Report, location of fields, groups, details, resources, results, set the chart settings, control the output of the header, parameters, and selection, determine the position of the resources and fix the header and the grouping columns of the report version.


In conclusion, I would like to note that the report settings can not only be saved as a report version, but also to upload to the file ("More" - "Save Settings"). To download, select "Load Settings" and select the saved file. Thus, we can transmit the settings of the report option between different bases that have the same configuration.


Based on this, we can summarize that the user can not only configure the report to his needs, but also save its settings and use them later if necessary.



Did you like the article? Share it