TableBandDesign header = createTableBand( headerSlot ); header.setBandType( TableBandDesign.BAND_HEADER ); table.setHeader( header );
if ( headerSlot.getCount( ) > 0 ) { TableBandDesign header = createTableBand( headerSlot ); header.setBandType( TableBandDesign.BAND_HEADER ); table.setHeader( header ); }
	public void visitTable( TableHandle handle )	{		// Create Table Item		TableItemDesign table = new TableItemDesign( );		table.setRepeatHeader( handle.repeatHeader( ) );		setupListingItem( table, handle );		// Handle table caption		String caption = handle.getCaption( );		String captionKey = handle.getCaptionKey( );		if ( caption != null || captionKey != null )		{			table.setCaption( captionKey, caption );		}		// Handle table Columns		SlotHandle columnSlot = handle.getColumns( );		for ( int i = 0; i < columnSlot.getCount( ); i++ )		{			ColumnHandle columnHandle = (ColumnHandle) columnSlot.get( i );			apply( columnHandle );			if ( currentElement != null )			{				ColumnDesign columnDesign = (ColumnDesign) currentElement;				for ( int j = 0; j < columnHandle.getRepeatCount( ); j++ )				{					table.addColumn( columnDesign );				}			}		}		// Handle Table Header		SlotHandle headerSlot = handle.getHeader( );		TableBandDesign header = createTableBand( headerSlot );		header.setBandType( TableBandDesign.BAND_HEADER );		table.setHeader( header );		// Handle grouping in table		SlotHandle groupSlot = handle.getGroups( );		for ( int i = 0; i < groupSlot.getCount( ); i++ )		{			apply( groupSlot.get( i ) );			if ( currentElement != null )			{				GroupDesign group = (GroupDesign) currentElement;				group.setGroupLevel( i );				table.addGroup( group );			}		}		// Handle detail section		SlotHandle detailSlot = handle.getDetail( );		TableBandDesign detail = createTableBand( detailSlot );		detail.setBandType( TableBandDesign.BAND_DETAIL );		table.setDetail( detail );		// Handle table footer		SlotHandle footerSlot = handle.getFooter( );		TableBandDesign footer = createTableBand( footerSlot );		footer.setBandType( TableBandDesign.BAND_FOOTER );		table.setFooter( footer );		new TableItemDesignLayout( ).layout( table );		//setup the supressDuplicate property of the data items in the 		//detail band						detail = (TableBandDesign) table.getDetail( );				for ( int i = 0; i < detail.getRowCount( ); i++ )		{			RowDesign row = detail.getRow(i);			for (int j = 0; j < row.getCellCount( ); j++)			{				CellDesign cell = row.getCell( j );				ColumnDesign column = table.getColumn( cell.getColumn( ) );				if ( column.getSuppressDuplicate( ) )				{					for ( int k = 0; k < cell.getContentCount( ); k++ )					{						ReportItemDesign item = cell.getContent( k );						if ( item instanceof DataItemDesign ) 						{							DataItemDesign dataItem = ( DataItemDesign )item;							dataItem.setSuppressDuplicate( true );						}					}				}				if ( !column.hasDataItemsInDetail( ) )				{					for ( int k = 0; k < cell.getContentCount( ); k++ )					{						ReportItemDesign item = cell.getContent( k );						if ( item instanceof DataItemDesign ) 						{							column.setHasDataItemsInDetail( true );							break;						}					}				}			}		}				currentElement = table;	}