// export
try
{
OdfSpreadsheetDocument doc = OdfSpreadsheetDocument.createSpreadsheetDocument();
OdfFileDom contentDoc = doc.getContentDom();
// Remove the default table added in construction
Element spreadsheetElement = ( Element ) contentDoc.getElementsByTagNameNS( OdfNamespace.OFFICE.getUri(),
"spreadsheet" ).item( 0 ); //$NON-NLS-1$
OdfTable table = ( OdfTable ) ( spreadsheetElement.getElementsByTagNameNS( OdfNamespace.TABLE.getUri(),
"table" ).item( 0 ) ); //$NON-NLS-1$
table.getParentNode().removeChild( table );
// create the table
table = new OdfTable( contentDoc );
table.setName( "Export" ); //$NON-NLS-1$
Element officeSpreadsheet = ( Element ) contentDoc.getElementsByTagNameNS( OdfNamespace.OFFICE.getUri(),
"spreadsheet" ).item( 0 ); //$NON-NLS-1$
officeSpreadsheet.appendChild( table );
// header
OdfTableRow headerRow = new OdfTableRow( contentDoc );