WorksheetWriter writer = new WorksheetWriter( zos, "xl/worksheets/sheet1.xml",
null, null, null );
writer.write( null );
writer.close();
final Metadata metadata = writer.getMetadata();
contentParts.add( metadata.getContentPart() );
wbRelationships.add( metadata.getRelationship() );
}
else {
for (int si = 0; si != sheets.length; si++) {
final WorksheetWriter writer = new WorksheetWriter( zos, "xl/worksheets/sheet" + (si + 1) + ".xml",
this.timeZone, sharedStrings, template );
writer.write( sheets[ si ] );
writer.close();
final Metadata metadata = writer.getMetadata();
contentParts.add( metadata.getContentPart() );
wbRelationships.add( metadata.getRelationship() );
}
}
// Stylesheet
{
final StylesheetWriter writer = new StylesheetWriter( zos, "xl/styles.xml" );
writer.write( template );
writer.close();
final Metadata metadata = writer.getMetadata();
contentParts.add( metadata.getContentPart() );
wbRelationships.add( metadata.getRelationship() );
}
// Shared Strings
{
final SharedStringsWriter writer = new SharedStringsWriter( zos, "xl/sharedStrings.xml" );
writer.write( sharedStrings );
writer.close();
final Metadata metadata = writer.getMetadata();
contentParts.add( metadata.getContentPart() );
wbRelationships.add( metadata.getRelationship() );
}
// Workbook
{
final WorkbookWriter writer = new WorkbookWriter( zos, "xl/workbook.xml" );
writer.write( this.model );
writer.close();
final Metadata metadata = writer.getMetadata();
contentParts.add( metadata.getContentPart() );
rootRelationships.add( metadata.getRelationship() );
}
// Relationships
{
final RelationshipSaver writer = new RelationshipSaver( zos, "xl/workbook.xml" );