Java Reference
In-Depth Information
Scriptlets
JasperReports allows us to execute snippets of Java code at certain points during
the report filling process. We can accomplish this by writing scriptlets. All scriptlets
must extend either net.sf.jasperreports.engine.JRAbstractScriptlet or net.
sf.jasperreports.engine.JRDefaultScriptlet . Following is a brief explanation
on these classes:
JRAbstractScriptlet contains a number of abstract methods that must be
overridden in every implementation. These methods are called automatically
by JasperReports at the appropriate moment.
JRDefaultScriptlet is a convenience class containing default empty
implementations of every method in JRAbstractScriptlet . It can
be used whenever we wish to override only a few of the methods in
JRAbstractScriptlet .
The following table summarizes these methods:
Method
Description
public void beforeReportInit()
Called before report initialization.
public void afterReportInit()
Called after report initialization.
public void beforePageInit()
Called before each page is initialized.
public void afterPageInit()
Called after each page is initialized.
public void beforeColumnInit()
Called before each column is initialized.
public void afterColumnInit()
Called after each column is initialized.
public void
beforeGroupInit(String groupName)
Called before the group specified in the
parameter is initialized.
public void afterGroupInit(String
groupName)
Called after the group specified in the
parameter is initialized.
public void beforeDetailEval()
Called before each record in the detail section
of the report is evaluated.
public void afterDetailEval()
Called after each record in the detail section
of the report is evaluated.
 
Search WWH ::




Custom Search