Special Fields
Special fields are defined by Logi Report and allow users to easily obtain system information and report-related data and add them to users' report.
This topic includes the following sections:
- Special Fields Supported by Logi Report
- Inserting Special Fields in a Report
- Adding Conditional Formats to Special Fields
See an example: The SampleComponents catalog, included with Logi Report Designer, contains reports that have examples of how each component type could be used in a report. For the special field example, open <install_root>\Demo\Reports\SampleComponents\ForSpecialFields.cls
.
Special Fields Supported by Logi Report
Special fields are defined by Logi Report and allow you to easily obtain system information and report-related data and add it to your report. The special fields are as follows:
Date-time
Lists all the datetime type special fields.
- Print Date
Prints today's date (or the current date from your computer). - Print Time
Prints the current time from your computer. - Fetch Date
Prints the date when the data is retrieved from the database. - Fetch Time
Prints the time when the data is retrieved from the database. - Modified Date
Prints the last modified date of the catalog. - Modified Time
Prints the last modified time of the catalog.
Computed
Lists all the special fields that are computed based on the report.
- Record Number
Prints the record number (usually placed in the Details panel). - Group Name
Prints the group name (usually placed in the Group Header/Footer panel). - Total Records
Prints the total number of records after all the filter conditions are performed, except the ones created in the Filter dialog of Page Report Studio, and the Group Filter dialog and top N or bottom N condition in Logi Report Designer. - Total Fetched Records
Prints the total number of records which take part in grouping calculation. The possible result of the special field is as follows:- If you don't set any filter condition in the Filter dialog of Page Report Studio, print the number of the record obtained after setting the property Maximum Records.
- If you set filter conditions in the Filter dialog of Page Report Studio, print the number of records obtained after performing the filters, even though you have set the property Maximum Records before setting the filters.
- Group Number
Prints the group number (usually placed in the Group Header/Footer panel). - Total Group Number
Prints the total group number (usually placed in the Group Header/Footer panel). - Page Number
Prints the page number of the component which it is placed in. - Global Page Number
Prints the global page number of the whole report wherever it is placed. - Total Page Number
Prints the total number of pages of the component which it is placed in. - Global Total Page Number
Prints the global total number of pages of the whole report wherever the field is placed. - Page N of M
Prints a specific page number out of the total page number of the component which the field is placed in. You can specify the format of this special field. To do this, select this special field, then in the Report Inspector, find the Format property and choose an item from the shortcut list. Besides the items listed here, you can also customize the format. For example, if you want it displayed as "This is page n of m pages", you can type the format string "This is page @PageNumber of @TotalPageNumber pages" in the Format text box. - Global Page N of M
Prints a specific global page number out of the global total page number of the report. You can specify the format of this special field in the Report Inspector. The operation is the same as Page N of M. - SQL Statement
Prints the SQL statements used to execute the query. This is often useful for resolving performance issues as you can see exactly what is passed to the database after all the parameter substitutions and filters are applied. - Query Filter
Prints in the report result the condition of the query filters applied to the parent data container of the special field. - Filter
Prints in the report result the filter conditions applied to the parent data container of the special field, which are created using the Filter dialog and via the Filter option on a field’s shortcut menu. - On-screen Filter
Prints in the report result the on-screen filter conditions applied to the parent data container of the special field, which are created using filter controls and via the Filter panel in Web Report Studio. - Go To Filter
Prints in the report result the filter conditions applied to the parent data container of the special field, which are generated via the drill-down and drill-to-by-value actions.
System
Lists all the special fields which get values from the system.
- User Name
Prints the User ID. When viewing the report in Logi Report Designer, it is the name specified for the User Name option in the General category of the Options dialog (to open the dialog, select File > Options); at runtime, the user name used to log onto Logi Report Server will be applied.Besides using as a component in report directly, the User Name special field can also be used in the following cases:
- The PARAMETER string of general hierarchical data sources
- The PARAMETER string of user defined data sources
- Parameters of stored procedures
- SQL statements
- Aggregation pipeline expressions (APE) in MongoDB connections
- JSON connections
- Elasticsearch connections
- Formulas
- Filter conditions of query filter, business view filter and dataset filter
- Security conditions of record level security (RLS) at data source scope
It should be used as username in stored procedures and formulas and as @username in HDS, UDS, SQL statement, APE, JSON, filter conditions, and RLS security conditions.
- Task ID
Prints the internal task ID (a unique time stamp). This special field only works in the Logi Report Server environment. It returns a NULL value when running in Logi Report Designer. - Report Path on Server
Prints the full path of the report in the Logi Report Server resource tree. If the report is not running on Logi Report Server, it returns the full disk path of the report. It returns a NULL value if the report is unsaved. - Report Path on Disk
Prints the full disk path of the report. It returns a NULL value if the report is unsaved. - Catalog Path on Server
Prints the full path of the report's catalog in the Logi Report Server resource tree. If the report is not running on Logi Report Server, it returns the full disk path of the catalog. It returns a NULL value if the report is unsaved. - Catalog Path on Disk
Prints the full disk path of the report's catalog. It returns a NULL value if the report is unsaved.
Note: You can insert all special fields into web reports and library components in Logi Report Designer. However, due to the characteristics of Web Report Studio and JDashboard, only these can be rendered and edited at runtime: Modified Date, Modified Time, Print Date, Print Time, Fetch Date, Fetch Time, Record Number, Total Records, Group Number, Total Group Number, User Name, Report Path on Server, Report Path on Disk, Catalog Path on Server, Catalog Path on Disk, Query Filter, Filter, On-screen Filter and Go To Filter.
Inserting Special Fields in a Report
Special fields can be inserted in the report areas listed in Component Placement.
To insert a special field into a report:
- Position the mouse pointer at the destination where the special field is to be inserted.
- Select Insert > Special Fields or Home > Insert > Special Fields, and select the required field from the drop-down menu.
Special fields in a report can be used as the trigger object of links, and you can change their display types if you want.
Adding Conditional Formats to Special Fields
You can add conditional formats to special fields in a report, then when a specified condition is fulfilled, the format defined on the condition will be applied to the field values automatically. This is very useful to highlight values that might need to be acted on by end users.
Conditional format can be applied only to the two special fields: Page Number and User Name.
To add conditional format to the special field Page Number/User Name, right-click it and select Conditional Formatting from the shortcut menu, then take the same procedure as described in Adding Conditional Formats to DBFields.