OdfTableRow row = new OdfTableRow( contentDoc );
table.appendChild( row );
if ( exportDn )
{
OdfTableCell cell = new OdfTableCell( contentDoc );
cell.setValueType( OdfValueType.STRING );
cell.setStringValue( record.getDnLine().getValueAsString() );
row.appendCell( cell );
}
for ( String attributeName : attributeMap.keySet() )
{
if ( !headerRowAttributeNameMap.containsKey( attributeName ) )
{
short cellNum = ( short ) headerRowAttributeNameMap.size();
headerRowAttributeNameMap.put( attributeName, new Short( cellNum ) );
OdfTableCell cell = new OdfTableCell( contentDoc );
cell.setValueType( OdfValueType.STRING );
cell.setStringValue( attributeName );
headerRow.appendCell( cell );
}
}
for ( String attributeName : headerRowAttributeNameMap.keySet() )
{
String value = attributeMap.get( attributeName );
if ( value == null )
{
value = ""; //$NON-NLS-1$
}
OdfTableCell cell = new OdfTableCell( contentDoc );
cell.setValueType( OdfValueType.STRING );
cell.setStringValue( value );
row.appendCell( cell );
}
}