private Group getInnerMostGroup() { Group existingGroup = rootGroup; while ( existingGroup != null ) { Group next = existingGroup.getBody().getGroup(); if ( next == null ) { return existingGroup; } existingGroup = next; } throw new IllegalStateException( "We shall never reach this point." ); }
public CrosstabCellBody getCrosstabCellBody() { final Group group = getInnerMostGroup(); final GroupBody body = group.getBody(); if ( body instanceof CrosstabCellBody ) { return (CrosstabCellBody) body; } return null; }
public CrosstabCellBody getCrosstabCellBody() { final GroupBody body = getInnerMostGroup().getBody(); if ( body instanceof CrosstabCellBody ) { return (CrosstabCellBody) body; } return null; }
private Group getInnerMostRelationalGroup() { Group existingGroup = rootGroup; GroupBody gb = existingGroup.getBody(); while ( gb != null ) { final int count = gb.getElementCount(); boolean found = false; for ( int i = 0; i < count; i++ ) { final ReportElement element = gb.getElement( i ); if ( element instanceof RelationalGroup ) { existingGroup = (Group) element; gb = existingGroup.getBody(); found = true; break; } } if ( found == false ) { gb = null; } } return existingGroup; }
/** * Returns the "no-data" band, which is displayed if there is no data available. * * @return The no-data band. */ public NoDataBand getNoDataBand() { final Group group = getInnerMostGroup(); final GroupBody body = group.getBody(); if ( body instanceof GroupDataBody ) { final GroupDataBody dataBody = (GroupDataBody) body; return dataBody.getNoDataBand(); } return null; }
/** * Returns the report's item band. * * @return the item band (never <code>null</code>). */ public ItemBand getItemBand() { final Group group = getInnerMostGroup(); final GroupBody body = group.getBody(); if ( body instanceof GroupDataBody ) { final GroupDataBody dataBody = (GroupDataBody) body; return dataBody.getItemBand(); } return null; }
/** * Returns the item band. * * @return The item band. */ public ItemBand getItemBand() { final Group group = getInnerMostGroup(); final GroupBody body = group.getBody(); if ( body instanceof GroupDataBody ) { final GroupDataBody dataBody = (GroupDataBody) body; return dataBody.getItemBand(); } return null; }
/** * Returns the details header band. * * @return The details header band. */ public DetailsHeader getDetailsHeader() { final Group group = getInnerMostGroup(); final GroupBody body = group.getBody(); if ( body instanceof GroupDataBody ) { final GroupDataBody dataBody = (GroupDataBody) body; return dataBody.getDetailsHeader(); } return null; }
/** * Returns the details header band. * * @return The details header band. */ public DetailsFooter getDetailsFooter() { final Group group = getInnerMostGroup(); final GroupBody body = group.getBody(); if ( body instanceof GroupDataBody ) { final GroupDataBody dataBody = (GroupDataBody) body; return dataBody.getDetailsFooter(); } return null; }
private List<SortConstraint> collectSortData( final Group rootGroup, final ArrayList<SortConstraint> sorts ) { sorts.addAll( rootGroup.getSortingConstraint() ); GroupBody body = rootGroup.getBody(); Group group = body.getGroup(); if ( group == null ) { // todo: Allow additional sorting based on item/detail data? return sorts; } return collectSortData( group, sorts ); } }
public ProcessState commit( final ProcessState next ) throws ReportProcessingException { final Group group = next.getReport().getGroup( next.getCurrentGroupIndex() ); final GroupBody body = group.getBody(); if ( body instanceof CrosstabColumnGroupBody ) { next.setAdvanceHandler( BeginCrosstabColumnAxisHandler.HANDLER ); } else if ( body instanceof CrosstabCellBody ) { next.setAdvanceHandler( BeginCrosstabFactHandler.HANDLER ); } else { throw new IllegalStateException( "This report is totally messed up!" ); } return next; }
/** * Adds a group to the report. This replaces the group body on the group with a new data-group-body composed of the * existing itemband and no-databand. * * @param group * the group. */ public void addGroup( final RelationalGroup group ) { if ( group == null ) { throw new NullPointerException( "AbstractReporDefinition.addGroup(..) : Null not permitted" ); } final Group existingGroup = getInnerMostRelationalGroup(); final GroupBody gb = existingGroup.getBody(); existingGroup.setBody( new SubGroupBody( group ) ); group.setBody( gb ); }
public ProcessState commit( final ProcessState next ) throws ReportProcessingException { final Group group = next.getReport().getGroup( next.getCurrentGroupIndex() ); final GroupBody body = group.getBody(); if ( body instanceof CrosstabRowGroupBody ) { next.setAdvanceHandler( BeginCrosstabRowAxisHandler.HANDLER ); } else if ( body instanceof CrosstabOtherGroupBody ) { next.setAdvanceHandler( BeginCrosstabOtherAxisHandler.HANDLER ); } else { throw new IllegalStateException( "This report is totally messed up!" ); } return next; }
/** * Returns the report's no-data band. * * @return the no-data band (never <code>null</code>). */ public NoDataBand getNoDataBand() { Group innerMostRelationalGroup = getInnerMostRelationalGroup(); if ( innerMostRelationalGroup instanceof CrosstabGroup ) { CrosstabGroup cg = (CrosstabGroup) innerMostRelationalGroup; return cg.getNoDataBand(); } GroupBody body = innerMostRelationalGroup.getBody(); if ( body instanceof GroupDataBody ) { GroupDataBody gd = (GroupDataBody) body; return gd.getNoDataBand(); } return null; }
public static boolean isLastColumnGroup( final ReportEvent event ) { final int gidx = event.getState().getCurrentGroupIndex(); final Group group = event.getReport().getGroup( gidx ); if ( group.getBody() instanceof CrosstabCellBody ) { return true; } return false; }
public void removeGroup( final CrosstabGroup group ) { if ( group == null ) { throw new NullPointerException( "AbstractReporDefinition.addGroup(..) : Null not permitted" ); } if ( rootGroup == group ) { removeRootGroup(); return; } final Group existingGroup = getInnerMostRelationalGroup(); final GroupBody gb = existingGroup.getBody(); if ( gb instanceof SubGroupBody ) { final SubGroupBody sgb = (SubGroupBody) gb; if ( sgb.getGroup() == group ) { existingGroup.setBody( new GroupDataBody() ); } } }
public ProcessState commit( ProcessState next ) throws ReportProcessingException { final Group group = next.getReport().getGroup( next.getCurrentGroupIndex() ); final GroupBody body = group.getBody(); if ( body instanceof CrosstabRowGroupBody ) { next.setAdvanceHandler( BeginCrosstabRowAxisHandler.HANDLER ); } else if ( body instanceof CrosstabColumnGroupBody ) { next = next.recordCrosstabRowState(); next.setAdvanceHandler( BeginCrosstabColumnAxisHandler.HANDLER ); } else { throw new IllegalStateException( "This report is totally messed up!" ); } return next; }
public ProcessState commit( final ProcessState next ) throws ReportProcessingException { final Group group = next.getReport().getGroup( next.getCurrentGroupIndex() ); final GroupBody body = group.getBody(); if ( body instanceof CrosstabColumnGroupBody ) { next.setAdvanceHandler( PrintSummaryBeginCrosstabColumnAxisHandler.HANDLER ); } else if ( body instanceof CrosstabCellBody ) { next.setAdvanceHandler( PrintSummaryProcessCrosstabFactHandler.HANDLER ); } else if ( body instanceof CrosstabRowGroupBody ) { next.setAdvanceHandler( PrintSummaryBeginCrosstabColumnAxisHandler.HANDLER ); } else { throw new IllegalStateException( "This report is totally messed up!" ); } return next; }
public void groupStarted( final ReportEvent event ) { if ( rowbandingOnGroup == false ) { return; } if ( StringUtils.isEmpty( group ) ) { final Group group = event.getReport().getGroup( event.getState().getCurrentGroupIndex() ); if ( group instanceof CrosstabRowGroup ) { final GroupBody body = group.getBody(); if ( body instanceof CrosstabColumnGroupBody ) { triggerVisibleStateCrosstab( event ); } } } else { if ( FunctionUtilities.isDefinedGroup( group, event ) ) { triggerVisibleStateCrosstab( event ); } } }
/** * Processes the group header of the current group. * * @param event * the event. */ public void groupStarted( final ReportEvent event ) { if ( FunctionUtilities.isLayoutLevel( event ) == false ) { // dont do anything if there is no printing done ... return; } if ( isExecutable() == false ) { return; } final Group group = FunctionUtilities.getCurrentGroup( event ); evaluateElement( group ); processGroupHeaders( group ); evaluateElement( group.getBody() ); processFooterBands( event.getState() ); }