/** * Searches a group by its defined name. This method returns null, if the group was not found. * * @param name * the name of the group. * @return the group or null if not found. */ public Group getGroupByName( final String name ) { if ( name == null ) { // Groups cannot have a null-name return null; } final Group[] cache = getGroupCache(); final int length = cache.length; for ( int i = 0; i < length; i++ ) { if ( name.equals( cache[i].getName() ) ) { return cache[i]; } } return null; }
public boolean matches( final String name ) { if ( ObjectUtilities.equal( name, getName() ) ) { return true; } return ObjectUtilities.equal( name, getGeneratedName() ); }
/** * Returns true if the events current groupname is equal to the group name. * * @param groupName * the group name. * @param event * the report event. * @return A boolean. */ public static boolean isDefinedGroup( final String groupName, final ReportEvent event ) { if ( groupName == null ) { return false; } final int groupIndex = event.getState().getCurrentGroupIndex(); final Group group = event.getReport().getGroup( groupIndex ); if ( groupName.equals( group.getName() ) ) { return true; } if ( groupName.equals( group.getGeneratedName() ) ) { return true; } return false; }
/** * Writes the header of the current group. * * @param event * the event. */ public void groupStarted( final ReportEvent event ) { if ( event.getState().isPrepareRun() ) { return; } try { final Group g = event.getReport().getGroup( event.getState().getCurrentGroupIndex() ); if ( g instanceof RelationalGroup ) { RelationalGroup rg = (RelationalGroup) g; w.write( "<groupheader name=\"" ); w.write( entityParser.encodeEntities( g.getName() ) ); w.write( "\">" ); writeBand( rg.getHeader() ); w.write( "</groupheader>" ); } } catch ( IOException ioe ) { XMLWriter.logger.error( "Error writing the band", ioe ); } }
/** * Writes the footer of the current group. * * @param event * the event. */ public void groupFinished( final ReportEvent event ) { if ( event.getState().isPrepareRun() ) { return; } try { final Group g = event.getReport().getGroup( event.getState().getCurrentGroupIndex() ); if ( g instanceof RelationalGroup ) { RelationalGroup rg = (RelationalGroup) g; w.write( "<groupfooter name=\"" ); w.write( entityParser.encodeEntities( g.getName() ) ); w.write( "\">" ); writeBand( rg.getFooter() ); w.write( "</groupfooter>" ); } } catch ( IOException ioe ) { XMLWriter.logger.error( "Error writing the band", ioe ); } }
public void enterGroup() { recorder.enterGroup(); currentGroupIndex += 1; final Group group = report.getGroup( currentGroupIndex ); groupStarts.push( new GroupStartRecord( getCurrentRow(), group.getName(), group.getGeneratedName() ) ); groupSequenceCounter.increment( currentGroupIndex ); groupSequenceCounter.set( currentGroupIndex + 1, 0 ); if ( groupStarts.size() != currentGroupIndex + 1 ) { throw new IllegalStateException(); } }
o.setCrosstabFilterGroup( lastColumnGroup.getName() ); } else { final CrosstabColumnGroup columnGroup = findColumnGroup( columnField );
/** * Writes the GroupHeader of the current group. * * @param event * the event. */ public void groupStarted( final ReportEvent event ) { if ( ( event.getState().isPrepareRun() ) || ( isEnableGroupHeader() == false ) ) { final int currentIndex = event.getState().getCurrentGroupIndex(); final Group g = event.getReport().getGroup( currentIndex ); collectSubReports( g, ElementMetaData.TypeClassification.HEADER ); return; } try { final int currentIndex = event.getState().getCurrentGroupIndex(); final CSVRow row = new CSVRow( quoter ); if ( isWriteStateColumns() ) { row.append( currentIndex ); final Group g = event.getReport().getGroup( currentIndex ); final String bandInfo = "groupheader name=\"" + g.getName() + '\"'; row.append( bandInfo ); } writeDataRow( event.getDataRow(), row ); row.write( getWriter() ); final Group g = event.getReport().getGroup( currentIndex ); collectSubReports( g, ElementMetaData.TypeClassification.RELATIONAL_HEADER ); } catch ( IOException ioe ) { throw new FunctionProcessingException( "Error writing the current datarow", ioe ); } }
/** * Writes the GroupFooter of the active group. * * @param event * the event. */ public void groupFinished( final ReportEvent event ) { if ( ( event.getState().isPrepareRun() ) || ( isEnableGroupFooter() == false ) ) { final int currentIndex = event.getState().getCurrentGroupIndex(); final Group g = event.getReport().getGroup( currentIndex ); collectSubReports( g, ElementMetaData.TypeClassification.FOOTER ); return; } try { final int currentIndex = event.getState().getCurrentGroupIndex(); final CSVRow row = new CSVRow( quoter ); if ( isWriteStateColumns() ) { row.append( currentIndex ); final Group g = event.getReport().getGroup( currentIndex ); final String bandInfo = "groupfooter name=\"" + g.getName() + '\"'; row.append( bandInfo ); } writeDataRow( event.getDataRow(), row ); row.write( getWriter() ); final Group g = event.getReport().getGroup( currentIndex ); collectSubReports( g, ElementMetaData.TypeClassification.RELATIONAL_FOOTER ); } catch ( IOException ioe ) { throw new FunctionProcessingException( "Error writing the current datarow", ioe ); } }