- Print
- PDF
To open a report’s Structure, navigate to Lasernet > Common > Reports > Setup > Structure.
For ease of use, this section of our guide is divided into paragraphs, each named after a section of the Structure page or a function.
Top Pane Functions
The Add section and Remove section buttons enable you to either add or remove a section.
Use the Move and Copy buttons to move or copy sections within the current report or to another report. These actions also include conditions.
The Up and Down buttons can be used for moving sections within the report.
To reload your report fields, click the Reload report fields button. A Reset modifications option will then appear.
Use Reset modifications to reset all modifications to default values, such as sorting, number of decimals, conditions, type changes, label changes, and more. This will not remove or change your custom-added yellow fields.
To learn more about the use of the Naming Patterns button, visit this page.
Section and Condition
The Name field indicates the name of the section in the report, while the Output field indicates the name of the section in the XML. These are the same by default. However, you can overwrite the Output to your liking.
It is possible to hide a section in the structure. To toggle the section visibility, use the eye icon:
A Condition can be used to control whether to show or hide the section.
None: The section will always be shown.
Code: An expression can be used. The section will be visible if the code condition expression is True or 1; it will be hidden if the code condition expression is False or 0.
Query: Query filters and ranges can be used. The section will be visible if the query filters or ranges are met; it will be hidden if the query filters or ranges are not met.
Fields
The New and Delete buttons enable you to add or delete custom fields.
The Up and Down buttons enable you to move fields within this section.
You can sort field records in the Fields grid by using the Sort by button. It is possible to sort records by name, output, or expression:
Name: the fields are sorted alphabetically using the Name column.
This is the result:
Output: the fields are sorted alphabetically using the Output column.
This is the result:
Expression: the fields are sorted alphabetically using the Expression column.
This is the result:
Use the Move button to move fields within the current report or to another report. The action also includes conditions.
Use the Copy button to copy fields within the current report or to another report. The action also includes conditions.
The Tools dropdown includes the option Convert to query link. This option converts the currently selected Subreport element into a Query and links it to the current Query. For more information on Query links, consult this section of the User Guide.
In the Visible column of the Fields grid, you can easily show or hide a field. By default, all fields are activated (visible). If you want to test a report without a field, click the icon in the Visible column for that field record to disable it, then print the report again.
Note
The Visible field only hides the field from the XML. Hidden fields are still fetched when running the query.
A Condition can be used to control whether to show or hide the field.
None: The section will always be shown.
Code: An expression can be used. The section will be visible if the code condition expression is True or 1; it will be hidden if the code condition expression is False or 0.
Query: Query filters and ranges can be used. The section will be visible if the query filters or ranges are met; it will be hidden if the query filters or ranges are not met.
The Name column indicates the name of the field, while the Output column indicates the name of the field in the XML. These are the same by default. However, you can overwrite the Output to your liking.
The Expression column is the field value and can handle a variety of custom fields. The following table provides details about available fields.
Field name | Description |
---|---|
Aggregate | Sum, Running Sum, Count, Running count, Average, Min, Max |
Calculate | Various predefined system values |
Convert | The Convert option can be selected in an expression, and it is possible to make several conversions in the same expression (conversion on conversion). |
CustomCode | Codes that can be created in X++. |
CustomProperty | The Custom Properties option in the dialog from which the report was initiated. |
Enum | Enumeration values |
Expression | Expression/formula for calculation |
Label | Microsoft system labels that are displayed in the report language using Microsoft predefined translations. |
Language text | Selection of system labels and language texts |
Parameter | The Parameters option in the dialog from which the report was initiated. |
ReportValue | All existing field values from the report |
ReportValueFormatted | All existing fields from the report formatted as String values |
SubReport | Allows to select an already created query report. |
Value | Fixed values that are manually entered. |
Aggregate
The Aggregate function provides an option to build a structure containing calculations (a Calculation tree).
The calculation tree allows multiple calculations with different fields for grouping, including the option to add additional values at the line/group level of the calculation.
For aggregation, it is possible to select any existing value from a data source, report, etc., so there is no need to create placeholders for a value (adding an existing field into the element structure like the LineAmount and Qty fields).
Automatic summary creates a section in the XML and provides the option to include multiple calculations for multiple fields.
Calculations can be grouped using the Group by settings. These include the option to add additional values at the line/group level of the calculation.
Aggregation makes it possible to Group by, Calculate if, and add Additional values:
For aggregation, it is possible to select any existing value from a Data source, Report, etc. Therefore, there is no need to create placeholders for a value (which means adding an existing field into the element structure, such as the LineAmount and Qty fields).
The following is an example of Calculate if:
Subtotal for Qty and Lineamount for the Item group including a name of ItemGroup.
Subtotal for Qty and Lineamount for the Item number including the ItemName.
Expression
The Expression option from the dropdown menu opens the Expression editor. The Expression editor can be used to build expressions. These can range from simple expressions such as hard-coded values to more complex expressions that integrate functions and use logic.
Expressions can be used in multiple places within the Lasernet FO Connector, including, but not limited to, the report Structure, Conditions, and individual fields with the toolbox icon. For more information on the Expression editor, see the Expression Editor section of this guide.
SubReport
To add a Query report as a subreport to any existing report, follow these steps:
Navigate to Lasernet > Common > Reports.
Locate the report to which you want to add a Query report, then open it.
In the Filter pane on the left, you can see the report structure, representing the XML structure. Locate the section to which you want to add a Query report, then click it.
Under the Fields section, click the New button.
Within the new record that appears, specify a field Name and Output. Once you are done, open the dropdown combo box in the Expression field and select SubReport.
As a result, the Settings dialog opens: from the Report name dropdown combo box, select the report.
The If ranges are empty option allows for ensuring that subreports are not executed without any ranges or with empty ranges. Empty ranges or no ranges often cause slow performance as all the records can get fetched.
Selecting the Skip value ensures that a subreport is not executed if there are no ranges or if ranges are empty.
Selecting the Skip with warning value allows executing a subreport if there are no ranges or ranges are empty. With that, a warning like the following is shown:
Selecting the Run always value allows executing a subreport even if no ranges are applied, or no values are set for ranges.
In this example, leave If ranges are empty set to Skip.
Once you have selected the Query report, click the Filter button to set a link between the subreport and the main report by defining a table and its fields. This way, you can receive one post letter back when running the main report.
A Query dialog will open. Identify the subreport fields that will be used to link the subreport to the main report. If the field is not in the list, use +Add to add the table and field. Click the tools button to open the Expression editor.
In the Range Expression editor dialog that pops up, add the relevant table from the main report to complete the link between the subreport and the main report. First, click the Delete all button to remove any existing expressions.
Next, select the dropdown option for Select Value.
Select the relevant table from the main report in the dropdown. Then, click the dropdown again and select the relevant field from this table.
Once you are done, click the OK button on both panels to close them and save the changes.
After adding a filter, verify that the link between the subreport and the main report has been added. As a result, you can see the corresponding value (the table and its field) in the Customer account text box at the bottom of the Settings panel.
Once you have added the subreport, click the Save button to save changes.
The next time the report is used, the section to which you have added a subreport (Demo, in our example) is added to the resulting XML with the content of this subreport.
Data types are normally imported from the report but can be overwritten. To this end, use the Type column of the Fields grid.
Value | Description |
---|---|
String | A number of characters |
Integer | A number without a decimal separator |
Real | Numbers with a decimal separator, also called decimals |
Date | Contains year, month, day, hour, minute, and second. Refers to the Extended datatype on the field. |
Enum | An abbreviation for enumerated text: a set of literals. |
RString | Right-aligned string. It does not make sense to use it in an XML file like Lasernet. |
UtcDateTime | Contains year, month, day, hour, minute, and second |
Container | A container is a dynamic list of items containing primitive data types and/or some composite data types. |
VarString | A number of characters |
CData | Is used for encoding HTML within the XML document. |
Base64 file | Base 64 coded field |
Resolve labels | By selecting this option, it is possible to make a label translation for a field containing a label. |
GUID | A globally unique identifier |
Int64 | Represents a 64-bit signed integer. |
Time | Contains hours, minutes, and seconds. |
Azure storage | URL from or to Azure Storage |
Skip Testing allows marking a field to skip validation when testing using the Test and Performance Suite. For more information on Test and Performance Suite test exceptions, follow this link.
Documentation mapping provides the option to specify a reference to the design in Lasernet. This information will be visible on the export created when using the Generate report summary function.
Details
The fields available in the Details tab will depend on the currently selected field in the Fields grid.
Number of Decimals
This option is available for fields of type Real. Prices are normally defined with two decimals, while volume and weight are defined with three and four decimals, respectively. You can set the decimals to your preference.
Custom Format
The Custom format option allows overriding the data type format. It is only applied if Use regional settings is set on the report’s Parameters.
Custom format is available for the following types: Date, UtcDateTime, Real, and Time.
Date:
UtcsDateTime:
Real:
Time: