inlineDataRowRuntime = new InlineDataRowRuntime();
}
inlineDataRowRuntime.setState(event.getState());
final ExpressionRuntime oldRuntime;
final OutputFunction outputFunction = getOutputFunction();
if (outputFunction != null)
{
oldRuntime = outputFunction.getRuntime();
outputFunction.setRuntime(inlineDataRowRuntime);
}
else
{
oldRuntime = null;
}
try
{
// first check the flagged events: Prepare, Page-Start, -end, cancel and rollback
// before heading for the unflagged events ..
if ((type & ReportEvent.PAGE_STARTED) == ReportEvent.PAGE_STARTED)
{
firePageStartedEvent(event);
}
else if ((type & ReportEvent.PAGE_FINISHED) == ReportEvent.PAGE_FINISHED)
{
firePageFinishedEvent(event);
}
else if ((type & ReportEvent.ITEMS_ADVANCED) == ReportEvent.ITEMS_ADVANCED)
{
fireItemsAdvancedEvent(event);
}
else if ((type & ReportEvent.ITEMS_FINISHED) == ReportEvent.ITEMS_FINISHED)
{
fireItemsFinishedEvent(event);
}
else if ((type & ReportEvent.ITEMS_STARTED) == ReportEvent.ITEMS_STARTED)
{
fireItemsStartedEvent(event);
}
else if ((type & ReportEvent.GROUP_FINISHED) == ReportEvent.GROUP_FINISHED)
{
fireGroupFinishedEvent(event);
}
else if ((type & ReportEvent.GROUP_STARTED) == ReportEvent.GROUP_STARTED)
{
fireGroupStartedEvent(event);
}
else if ((type & ReportEvent.REPORT_INITIALIZED) == ReportEvent.REPORT_INITIALIZED)
{
fireReportInitializedEvent(event);
}
else if ((type & ReportEvent.REPORT_DONE) == ReportEvent.REPORT_DONE)
{
fireReportDoneEvent(event);
}
else if ((type & ReportEvent.REPORT_FINISHED) == ReportEvent.REPORT_FINISHED)
{
fireReportFinishedEvent(event);
}
else if ((type & ReportEvent.REPORT_STARTED) == ReportEvent.REPORT_STARTED)
{
fireReportStartedEvent(event);
}
else
{
throw new IllegalArgumentException();
}
}
finally
{
if (outputFunction != null)
{
outputFunction.setRuntime(oldRuntime);
}
}
}