5.3 onLoad Handler
The onLoad handler is similar to the onInit handler, and is also executed at the beginning of report generation. It differs from onInit in two important ways:
• onLoad script is executed every time a report is processed.
• onLoad script is executed after report parameter prompting.
The typical usages of the onLoad handler are the following:
• Declaring
report-level variables.
For example, to keep a subtotal on each page, declare the 'subtotal'
variable in the onLoad script and then
update it using onPageBreak
Handler script.
• Initializing
the report based on user input parameters.
For example, onLoad script can set chart
styles, report headers, element visibility, etc. The onLoad
handler has access to the 'parameter'
array that contains all report parameter values. For example, to hide
a chart if a parameter is false:
if(!parameter['showChart']) {
Chart1.visible = false;
}
• Dynamically
running queries.
An element's 'query' property can only be set in the onLoad
handler, not in element-level script. See Binding
Queries for details.
• Modifying binding characteristics (column visibility, grouping and summarization, etc.) using the element's bindingInfo attributes.
• Modifying multiple elements from a central location.
See Also
The Table bindingInfo Property, for information on data binding for Tables.
The Chart bindingInfo Property, for information on data binding for Charts.
The Section bindingInfo Property, for information on data binding for Sections.
onInit Handler, to declare session-level variables or report parameters.
| << 5.2 onInit Handler | © 1996-2013 InetSoft Technology Corporation (v11.5) | 5.4 onPageBreak Handler >> |