EGL has several ReportLib functions that increase the power of the report handler. The JasperReport design file can invoke an additional predefined Java™ method, getDataSource().
You can invoke any of the ReportLib functions in the following sections from within the report handler. Invoke getDataSource(), which is not a ReportLib function, from the XML design file source.
Function | Purpose |
---|---|
getReportParameter (parameter String in) | Returns the value of the specified parameter from the report that is being filled. The returned value is of type ANY. |
These functions give you access at run time to variables that the report uses.
Function | Purpose |
---|---|
getReportVariableValue (variable String in) | Returns the value of the specified variable from the report that is being filled. The returned value is of type ANY. |
setReportVariableValue (variable String in, value Any in) | Assigns the value to the specified variable. |
Function | Purpose |
---|---|
getFieldValue (fieldName String in) | Returns the value of the specified field value for the row currently being processed. The returned value is of type ANY. |
A subreport is a report that you call from within another report. To pass report data to a subreport, the report handler first saves the information using addReportData(). The JasperReports engine can retrieve this data by means of getDataSource(), which is described later in this topic. To retrieve previously saved data within the report handler, use the equivalent function getReportData().
Function | Purpose |
---|---|
addReportData (rd ReportData in, dataID String in) | Associates data (as stored in a variable of type ReportData) with the name dataID. |
getReportData (dataID String in) | Retrieves data that you previously stored under dataID using addReportData(). getReportData() returns a value of type ReportData. |
To access data that you will pass to a subreport, call the getDataSource() method of the EGL report library from your XML report design file.
Function | Purpose |
---|---|
getDataSource (dataID String in) | Within a report design file, retrieves data that you previously stored under dataID when you invoked addReportData() in the report handler. getDataSource() returns the data in an internal format. You must cast the return value as a JRDataSource for the subreport to be able to use that data. |
For examples how to use the functions described in this topic, see Creating an EGL report handler.
Related concepts
EGL report creation process overview
EGL reports overview
Related tasks
Creating an EGL report handler
Related reference
EGL library ReportLib
EGL report handler
Predefined EGL report handler functions
Report and ReportData parts