Calculate Custom Summaries via Scripts
- 2 minutes to read
This document describes how to evaluate custom summaries using report scripts within the End-User Report Designer.
Create a new XRLabel, which is the only report control that supports custom summary calculations.
The value range encompassed by the summary function within a report implies an appropriate band to display the result. For example, the Group Header or Group Footer bands are most appropriate to display the result of a summary that is calculated within a group.
The label must be bound to any field that belongs to a data table involved in the script's calculations.
The following event handlers are available.
- XRLabelScripts.OnSummaryReset - Handle it to restore a current summary result to its default value (e.g., before traversing each group entry).
- XRLabelScripts.OnSummaryRowChanged - Handle it to retrieve the current row from the report's data source (e.g., before obtaining the current detail band record).
- XRLabelScripts.OnSummaryGetResult - Handle it to obtain the final summary result (e.g., before displaying it in a report). To complete a summary calculation, enable the Handled parameter.