Skip to main content

Using Render Events on Data Bands in Report Designer

T
Written by Tim Sublette

The articles in this section of the Knowledge Base involve working with Lists for display in your reports. To learn more about Lists and how to access the Report Designer, see Creating Lists in Report Designer. This article provides information on applying events to your data bands for use in your reports.

There are three special events that can be applied to a Data band, Rendering Event, Begin Render Event, and End Render Event. If there are ten rows in the Data Source to which the Data band has been assigned, then the Data band is printed ten times. The Begin Render Event is called before the data is rendered. It can be used to initialize some data as variables and calling some actions. The End Render Event is called after the data has been rendered when all data rows have been output. It is used for total calculation processing, amongst other things. The Rendering Event is called when rendering one data row. It is called before the Data band is printed. If there are ten rows in the Data Source, the Rendering Event is output ten times.

The following tutorial provides an example for working with these events:

  1. Create the “myvariable” variable in the Data Dictionary.

    1. Select the Page tab > select Panels > select Dictonary.

    2. Select New Item > New Variable.

    3. From the New Variable window, create a new int type variable named “myvariable.” See Figure 03.

  2. Close the Dictionary Window > select the Data band for the event to be applied to > select the Events tab > write the following code in the Begin Render Event:

  3. Add the following code to the Rendering Event:

  4. Enter the following expression into a text component where you want the myvariable value to be displayed:

  5. Set the Process at property of the Text Component to End of Report.

  6. Process your report. Your results should look something like Figure 07.


Did this answer your question?