try
{
int
rowCount = grid.getRowCount();
int headerCount =
grid.getHeaderCount();
boolean hasChildren =
grid.hasChildren();
if ( rowCount > 0
)
{
// - grid -
float
tablewidth=tableProperty.pageSize_.width()- MARGIN_LEFT -
MARGIN_RIGHT;
float
tableheight=tableProperty.pageSize_.height()- MARGIN_TOP - MARGIN_BOTTOM
;
table = new Table( headerCount
);
table.setWidths(tableProperty.widths_);
table.setBorderColor(
COLOR_BORDER );
table.setBorderWidth( 1
);
table.setPadding( PADDING
);
table.setBackgroundColor( Color.white );
for( int j=0; j<
grid.getGroupCount(); j++ )
{
table.setBorder(
Rectangle.TOP | Rectangle.LEFT | Rectangle.RIGHT );
if (
grid.getGroupId(j)!=null )
{
table.addCell( new Phrase(capitalize(
grid.getGroupId(j) ), headerFont )
);
}
else
{
table.addCell("");
}
}
}
// - data
-
table.setBorderWidth( 1
);
table.setBorderColor( COLOR_BORDER );
for ( int i = 0; i < rowCount;
i++ )
{
// - rows
-
for ( int j = 0; j < headerCount; j++
)
{
Object value =
grid.getValue( i, j );
// if this is the first
column.
if ( j == 0
)
{
table.setBorder(
Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM
);
table.setBackgroundColor( Color.WHITE
);
}
else
{
table.setBackgroundColor(
getFillBackground( grid.getValue( i, "UI_KEY_DISPLAY_ATTRIBUTE" ) )
);
table.setBorder( Rectangle.RIGHT |
Rectangle.BOTTOM );
}
}
catch( Exception exception
)
{
ReportAppLog.logStackTrace(ReportAppLog.ERROR,
exception);
}
}