Reporting User Guide

Create Reports : Miscellaneous : Handle Events via Scripts
Generally scripts are used for data-aware report formatting. Though Reporting enables users to perform such tasks without any scripting (see Conditionally Change a Control's Appearance, Conditionally Change a Label's Text and Conditionally Hide Bands), sometimes it may be required to use scripts, for example to achieve more specific results. The report's layout can be fully customised using of scripting.
When the ellipsis is clicked for any event, the Script Editor window is displayed:
To restore the default script, in the Script Editor window, click Default Script which will eliminate all the changes made to scripts.
The report engine generates a temporary class in memory. The names of the variables are defined by the Name properties of the controls and objects they represent. When the script is pre-processed, its namespace directives are taken from the script code and added to the namespace where the temporary class is defined.
The Script References property of the Report object specifies the full paths (including the file names) to the assemblies that are referenced in the scripts used in a report. These paths should be specified for all the assemblies that are included in scripts via using (C#), Imports (Visual Basic) or import (J#) directives.
Execute steps similar to those described in Add Totals to a Report, except that for the summary field, the Function property should be set to Custom.
Finally, switch to the Preview tab to view the result.

1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
AVEVA Logo