Using Variables in Other Report Properties
Variables (System and Pass Through) variables can also be used in certain properties on a report to dynamically effect them when a report is run. Some scenarios where this might be useful are listed below:
Example 1
You are specifying an output file in the “Generate Output File” property on a report and you want the file name to not be totally hard coded but to be effected by the System Variable such as the today’s date (@DATE@).
In the “Generate Output File” property specify a file name such as C:\MyReports\Sales_@[email protected]
Whenever the report is then run a copy will be saved with the name “Sales_” plus the date.
Example 2
You are specifying an output file in the “Generate Output File” property on a report and you want the file name to not be totally hard coded but to be effected by a Pass Through Parameter on the report named @REGION@
In the “Generate Output File” property specify a file name such as C:\MyReports\Sales_@[email protected]
Whenever the report is then run a copy will be saved with the name “Sales_” plus the Parameter specified for the @REGION@ pass through variable.
Example 3
You are using the PublishSheet Add-In on a report to publish to an HTML output file using the “Run Add-Ins” property on the report. You want the HTML file name to be effected by a Pass Through Parameter on the report named @REGION@
In the “Run Add-Ins-” property specify something similar to this : PLPLUGA.C.PublishSheet(Pivot,\\myserver\intranet\reports\Sales_@[email protected])
Whenever the report is then run a copy will be published with the name “Sales_” plus the Parameter specified for the @REGION@ pass through variable.
Example 4
You are using the EmialSMTP Add-In on a report to email the report using the “Run Add-Ins” property on the report. You want the Email address to be dynamic based on a Pass Through Variable that is entered at run time. The pass through variable is named @EMAILTO@
In the “Run Add-Ins-” property specify something similar to this: PLPLUGA.E.MailSMTP(MySMTPServ13,@EMAILTO@,[email protected],Your Sales Report,Please see attached file.,1,Report.xls)
Whenever the report is then run a copy will emailed to the email address specified in the parameter for the pass through variable @EMAILTO@
Example 5
You have written a macro into your reports template file in Excel that requires a Sales Rep to be passed in at Run time. The Macro is called AnalyseSalesRep and takes one parameter for the Sales Rep Code. You have defined a Pass Through Variable in the container and on the report called @SALESREP@ that you wish to pass in to the Macro so it can perform some specific logic.
In the “Run Macros” property specify something similar to this: AnalyseSalesRep(@SALESREP@)
Whenever the report is then the Macro will receive the selected Sales Rep code and execute.