Using System Variables
System variables can be used with Parameters and Filters to dynamically determine a comparison Value at report Run Time. An example of this is where a report is run and expected to return data for the current day. In this example a Filter could be set on the report for a Date field and the filter comparison value (or comparator) could be set to the system Variable @DATE@. When the report is run the system variable @DATE@ in the filter comparator will be replaced with the current date.
To select a System Variable when adding a Filter or Parameter click the System Variable button
on the Enter Comparison Value screen. The Select System Variables screen (shown below) will appear.
Select the required System Variable and click OK.
Custom System Variables
Note that the set of available System Variables defined can be extended by adding Custom System Variables to the Alchemex.ini file under the section [GlobalSysVars]. These Custom System Variables are hard-coded values in the Alchemex.ini file and cannot contain script logic. Each Variable must be added on a separate line under the section and must also be added to the comma separated list defined in the Active key under the [GlobalSysVars] section. An example of two Custom System Variables defined in the Alchemex.ini file is shown below. With this example the System Variables @FINYEARSTART@ and @FINYEAREND@ will be available to all reports in the Alchemex 7 Smart Reporting system.
[GlobalSysVars]
Active=@FINYEARSTART@,@FINYEAREND@
@FINYEARSTART@=01 March 2004
@FINYEAREND@=28 February 2005
System Variable Format
System Variables must always be prefixed and suffixed with a single @ symbol and must contain no other occurrences of an @ symbol. System Variable names must be unique. System Variables that do not comply with this format will not be recognized by Alchemex 7 Smart Reporting.
Considerations when using System Variables in Reports
It should be noted that Custom System Variables are defined in the Alchemex.ini file. Due to this the set of Custom System Variables will vary from site to site. If Custom System Variables are used on a report intended for distribution then the same definitions will have to be created at the destination sites. Ordinary System Variables are available to all Alchemex 7 Smart Reporting sites without the requirement to create them. This means that Reports intended for distribution should avoid using Custom System Variables where possible.
Listing Available System Variables
To obtain a list of all available system variables (Standard and Custom) select the Alchemex 7 Smart Reporting Home object in the Report Manager and from the Tools menu choose Show System Variables. A list of all available System Variables will be displayed.