You can even use custom Java objects in
your report to handle certain aspects of processing.
In this chapter, we are going to look at the two different types of Scripting that BIRT
has to offer, Expressions and Event Handling. We are going to look at how to access
different types of BIRT properties using Expressions. Then we are going to look at
how to handle report generation events using BIRT's implementation of the Rhino
engine, and also how to handle those same events using Java objects. Although a
prior knowledge of Java or JavaScript isn't necessary, it will greatly enhance the
understanding of the topics covered in this chapter. But to follow along effectively,
the reader should understand:
Variables
Types
Creation
Assignment
???
?° ?° ?°
Scripting and Event Handling
[ 236 ]
Operators
Arithmetic ithmetic
Logical ical
Comparison
Functions
Objects
Properties
Methods
Types of Scripting
In BIRT, there are two different types of scripting: Expressions and Event Handling.
Expressions are simple bits of Script (usually ranging from one to less than ten
lines of code) that return a single value for use in a BIRT report. Event Handlers are
usually a bit larger than Expressions, and are meant to accomplish some sort of task,
such as retrieve a row from a Data Set, manipulate data before output, or handle
preparations for rendering.
Pages:
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187