In on-premises installations of Geocortex Printing, you can include C# scripts in your
To use scripts in
Scripting is available in on-premises installations of Geocortex Printing only. Scripting is not available in cloud Printing.
In Geocortex Printing, scripts are custom event handlers. When you configure a script, you associate the script with a particular
Example 1: If you associate the script with the Report Header band and After Print event, the script will run immediately after the Report Header is generated.
Example 2: If you associate the script with a particular control and the Before Print event, the script will run immediately before the control is generated.
The script runs as many times as the associated
Example 3: If you associate the script with the Page Footer band, the script will run once per page, because the Page Footer is generated once per page.
Example 4: If you associate the script with the Report Footer band, the script will run once, because the Report Footer is generated once.
To add a script to a
print templatein Print Designer.
Click Scripts to open the Script Editor.
Specify when the script will run.
To do this, you need to associate the script with a
templateelement (a control, a band, or the print templateitself) and an event. The event will be fired relative to generation of the specified element. The script is the event handler—it runs whenever the event is fired for the specified element.
templateelement and event is mandatory. If you skip this step, the script will not run.
Select the element to associate the script with.
Drop-down list in the Script Editor to associate the script with a
Select the event.
Drop-down list in the Script Editor to select the event
The Script Editor creates a script stub. The script is named for the
templateelement and event that you selected.
Script stub created by the Script Editor
Type or paste the remainder of the script into the stub.
If you type the script, the Script Editor provides intelligent code completion as you type.
Click Validate to validate the script.
When the script is valid, click Designer to return to the design surface.
To test your script, preview the