I have found the Problem:
Without this Part, the Printer-Driver can`t find the Right "View" :
/xl/workbook.xml:
- Code: Select all
<bookViews>
<workbookView xWindow="510" yWindow="510" windowWidth="11175" windowHeight="9915"/>
</bookViews>
To add it I have do this:
- Code: Select all
SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();
workBook = pkg.getWorkbookPart();
// OF = "ObjectFactory OF = Context.getsmlObjectFactory();"
Workbook wb = OF.createWorkbook();
BookViews bookview = OF.createBookViews();
CTBookView ctBookview = OF.createCTBookView();
ctBookview.setXWindow(510);
ctBookview.setYWindow(510);
ctBookview.setWindowWidth(11175L);
ctBookview.setWindowHeight(9915L);
bookview.getWorkbookView().add(ctBookview);
wb.setBookViews(bookview);
// without this, there will be an "nullPointerException" in :
// SpreadsheetMLPackage
// _____createWorksheetPart([...])
// _________sheets.getSheet().add(s); <<--sheets is null without the next line
wb.setSheets(OF.createSheets());
workBook.setJaxbElement(wb);
@jason:
to Compare XML I use the "Compare"-Plugin from Notepad++ in combination with "XML Tools"-Plugin .
Thanks for Help!!!
Thread can be closed.