The DataLayer.Definition List element provides developers with programmatic information about the definitions used in their application. The data can then be used to create report menus, report management systems, and more.
For similar functionality for any file (not just definitions) see our DataLayer.Directory element.
The DataLayer.Definition List element has the following attributes:
Specifies an optional element ID. We recommend you specify one for easier identification when debugging.
|Definition List Folder||Enter a file system folder name here to restrict the results returned to definitions within a single folder. The folder named is assumed to be within the _Definitions folder of the application's project folder. Examples: _Processes, _Reports, _Templates, _Widgets Default: Returns data for all definitions|
The datalayer reads the definition data for the current project and caches it as rows and columns, with one row per definition file. Data retrieved into the datalayer is cached in the usual XML format.
The data retrieved with a datalayer is available using @Data tokens, in the format @Data.ColumnName~. The spelling of the column name is case-sensitive. The data is only available within the scope of the parent element of the datalayer, not throughout the entire report definition. The DataLayer.Linked element can be used to make the data reusable in another datalayer outside this scope.
Column returned into the datalayer and available through the @Data token are:
The definition name, as it appears in the Application panel, e.g. Default
|DefinitionType||The definition type, e.g. Report, Process, Template, or Widget|
|Caption||The Caption attribute value (for Report definitions).|
|EngineVersion||The build number of the version of the Logi Server Engine used, e.g. 12.0.30|
The fully-qualified filename of the definition file, e.g. |
For easier organization, Logi definition files can be named using period-separated prefixes, such as Accounting.ProfitLoss.lgx. The prefixes are referred to as folders, though they don't exist in the file system as such. This column returns the nth prefix or folder name for each definition. Examples:
For Accounting.Profits.lgx, the Folder1 column returns "Accounting"|
For New.Accounting.Profits.lgx, the Folder2 column returns "Accounting" Due to the optional nature of these prefixes, the AutoColumns element may not detect all instances of this column in the datalayer.
|ID||The Report ID from the report definition's root node, ID attribute.|
|SavedAt||The timestamp indicating when the definition was last saved, e.g. 3/8/2008 2:25 PM|
|SavedBy||User name of the person who last saved the definition.|
In the following example, you'll see how to use DataLayer.Definition List with an Input Select List element, so that users can select report definitions to see at runtime.
Start by adding an Input Select List element to your report definition and setting its attributes as shown above. Referring to the table of returned columns from the previous section, use "DefinitionName" for the Caption Column and Value Column attribute values.
Next, add a DataLayer.Definition List element beneath the input element, as shown above. You only want to present users with a choice of report definitions, so set the Definition List Folder attribute to _Reports. Without this, they'd also see Process, Widget, and all other definitions.
When you preview the report, you see that your list is populated, but there's a problem: the list includes many report definitions in subfolders that you don't want users to see. To fix this, filter the datalayer:
As shown above, add a Compare Filter beneath the datalayer. Set its attributes to keep only definitions that have an underscore in their names.
Now when we preview the definition again, we see that the list includes the desired set of definitions.