Class ReportEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.pentaho.reporting.engine.classic.core.event.ReportEvent
-
- All Implemented Interfaces:
Serializable
public class ReportEvent extends EventObject
Represents a report event. Includes information whichReportState
generated the event.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ARTIFICIAL_EVENT_CODE
static int
CROSSTABBING
Crosstab marker flag.static int
CROSSTABBING_COL
static int
CROSSTABBING_OTHER
static int
CROSSTABBING_ROW
static int
CROSSTABBING_TABLE
static int
DEEP_TRAVERSING_EVENT
A flag that marks the given event as a deep-traversing event.static int
GROUP_BODY_FINISHED
This is a layout-helper event.static int
GROUP_FINISHED
The event type constant, that a group finished event is invoked.static int
GROUP_STARTED
The event type constant, that a group start event is invoked.static int
ITEMS_ADVANCED
The event type constant, that the items advanced event is invoked.static int
ITEMS_FINISHED
The event type constant, that the items finished event is invoked.static int
ITEMS_STARTED
The event type constant, that the items started event is invoked.static int
NO_PARENT_PASSING_EVENT
static int
PAGE_FINISHED
The event type constant, that the page finished event is invoked.static int
PAGE_STARTED
The event type constant, that the page start event is invoked.static int
REPORT_DONE
The event type constant, that the report done event is invoked.static int
REPORT_FINISHED
The event type constant, that the report finished event is invoked.static int
REPORT_INITIALIZED
The event type constant, that the report initialize event is invoked.static int
REPORT_STARTED
The event type constant, that the report start event is invoked.static int
SUMMARY_ROW
This event is fired when a summary row is going to be printed.static int
SUMMARY_ROW_END
static int
SUMMARY_ROW_START
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ReportEvent(ReportState state, int type)
Creates a newReportEvent
.ReportEvent(ReportState state, ReportState originatingState, int type)
Creates a newReportEvent
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DataRow
getDataRow()
Returns the currently assigned dataRow for this event.int
getLevel()
Returns the current function level.ReportState
getOriginatingState()
Returns the originating state.ReportDefinition
getReport()
Returns the report that generated the event.ReportState
getState()
Returns theReportState
, which is the source of the event.int
getType()
Returns the event type.boolean
isDeepTraversing()
Checks whether the deep-traversing flag is set.static String
translateStateCode(int code)
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Field Detail
-
REPORT_INITIALIZED
public static final int REPORT_INITIALIZED
The event type constant, that the report initialize event is invoked.- See Also:
- Constant Field Values
-
PAGE_STARTED
public static final int PAGE_STARTED
The event type constant, that the page start event is invoked.- See Also:
- Constant Field Values
-
REPORT_STARTED
public static final int REPORT_STARTED
The event type constant, that the report start event is invoked.- See Also:
- Constant Field Values
-
GROUP_STARTED
public static final int GROUP_STARTED
The event type constant, that a group start event is invoked.- See Also:
- Constant Field Values
-
ITEMS_STARTED
public static final int ITEMS_STARTED
The event type constant, that the items started event is invoked.- See Also:
- Constant Field Values
-
ITEMS_ADVANCED
public static final int ITEMS_ADVANCED
The event type constant, that the items advanced event is invoked.- See Also:
- Constant Field Values
-
ITEMS_FINISHED
public static final int ITEMS_FINISHED
The event type constant, that the items finished event is invoked.- See Also:
- Constant Field Values
-
GROUP_FINISHED
public static final int GROUP_FINISHED
The event type constant, that a group finished event is invoked.- See Also:
- Constant Field Values
-
REPORT_FINISHED
public static final int REPORT_FINISHED
The event type constant, that the report finished event is invoked.- See Also:
- Constant Field Values
-
REPORT_DONE
public static final int REPORT_DONE
The event type constant, that the report done event is invoked.- See Also:
- Constant Field Values
-
PAGE_FINISHED
public static final int PAGE_FINISHED
The event type constant, that the page finished event is invoked.- See Also:
- Constant Field Values
-
SUMMARY_ROW
public static final int SUMMARY_ROW
This event is fired when a summary row is going to be printed. This is a crosstab only event, and happens after the group-finished event. Crosstab-aware functions must now select the result for the given group.- See Also:
- Constant Field Values
-
SUMMARY_ROW_START
public static final int SUMMARY_ROW_START
- See Also:
- Constant Field Values
-
SUMMARY_ROW_END
public static final int SUMMARY_ROW_END
- See Also:
- Constant Field Values
-
GROUP_BODY_FINISHED
public static final int GROUP_BODY_FINISHED
This is a layout-helper event. It is only passed down to layouter functions. This event is fired before a group-finished event is fired and helps the layouter to close the group-body so that keep-together and widows can compute their state properly.- See Also:
- Constant Field Values
-
CROSSTABBING
public static final int CROSSTABBING
Crosstab marker flag. This marks events that are part of a crosstab processing.- See Also:
- Constant Field Values
-
CROSSTABBING_TABLE
public static final int CROSSTABBING_TABLE
- See Also:
- Constant Field Values
-
CROSSTABBING_OTHER
public static final int CROSSTABBING_OTHER
- See Also:
- Constant Field Values
-
CROSSTABBING_ROW
public static final int CROSSTABBING_ROW
- See Also:
- Constant Field Values
-
CROSSTABBING_COL
public static final int CROSSTABBING_COL
- See Also:
- Constant Field Values
-
DEEP_TRAVERSING_EVENT
public static final int DEEP_TRAVERSING_EVENT
A flag that marks the given event as a deep-traversing event. This flag is an indicator, that the event did not originate in this report, so it propably came from a parent or child report.- See Also:
- Constant Field Values
-
NO_PARENT_PASSING_EVENT
public static final int NO_PARENT_PASSING_EVENT
- See Also:
- Constant Field Values
-
ARTIFICIAL_EVENT_CODE
public static final int ARTIFICIAL_EVENT_CODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReportEvent
public ReportEvent(ReportState state, int type)
Creates a newReportEvent
.- Parameters:
state
- the current state of the processed report (null
not permmitted).type
- the event type for this event object.
-
ReportEvent
public ReportEvent(ReportState state, ReportState originatingState, int type)
Creates a newReportEvent
.- Parameters:
state
- the current state of the processed report (null
not permmitted).originatingState
- the original state that generated the event.type
- the event type for this event object.
-
-
Method Detail
-
getType
public int getType()
Returns the event type. The type is made up of a combination of several flags.- Returns:
- the event type.
-
getState
public ReportState getState()
Returns theReportState
, which is the source of the event.- Returns:
- the state (never
null
).
-
getOriginatingState
public ReportState getOriginatingState()
Returns the originating state. The originating state is the state, that generated the event in the first place. For master reports this is the same as the event source, for master-reports receiving events from a sub-report, this is the subreport's report state.- Returns:
- the originating state.
-
getReport
public ReportDefinition getReport()
Returns the report that generated the event.This is a convenience method that extracts the report from the report state.
- Returns:
- the report.
-
getDataRow
public DataRow getDataRow()
Returns the currently assigned dataRow for this event. TheDataRow
is used to access the fields of the.DataSource
and other functions and expressions within the current row of the report.- Returns:
- the data row.
-
getLevel
public int getLevel()
Returns the current function level.- Returns:
- the function level.
-
isDeepTraversing
public boolean isDeepTraversing()
Checks whether the deep-traversing flag is set. An event is deep-traversing, if it did not originate in the current report.- Returns:
- true, if this is a deep-traversing element, false otherwise.
-
translateStateCode
public static String translateStateCode(int code)
-
-