Is it is possible to create empty Theme if I create XSSFWorkbook by constructor XSSFWorkbook()?
I tried to do this, but there is a lot of fields (like Relations) to fill when I create Theme - and finally I have to do something like reading inputStream. But I dont have IS, because I want create new workbook and fill everything using data from external JSON file.
Creating Theme is so complicated, so I tried to do this in some other ways too:
1) I tried to: import empty XLSX file to ApachePOI, get Theme from it and set this Theme to my new XSSFWorkbook. But then my new XLSX file doesnt have file /xl/theme/theme1.xmland informations:
in content_types.xml,
in /xl/_rels/workbook.xml.rels.
2) Then I tried to not create new XSSFWorkbook, but: import external XLSX file, change its Theme and save again as XLSX. Then file has informations about Theme, but about original - not changed.
I checked that constructor XSSFWorkbook() creates objects like StylesSource and SharedStringsTable, but not ThemesTable. So maybe it impossible to change Theme after constructor, because in fact it changes nothing?
Any suggestions? Please, help, Ive been trying for 3 days.
I tried to do this, but there is a lot of fields (like Relations) to fill when I create Theme - and finally I have to do something like reading inputStream. But I dont have IS, because I want create new workbook and fill everything using data from external JSON file.
Creating Theme is so complicated, so I tried to do this in some other ways too:
1) I tried to: import empty XLSX file to ApachePOI, get Theme from it and set this Theme to my new XSSFWorkbook. But then my new XLSX file doesnt have file /xl/theme/theme1.xmland informations:
Code:
<Override ContentType="application/vnd.openxmlformats-officedocument.theme+xml" PartName="/xl/theme/theme1.xml" />
Code:
<Override ContentType="application/vnd.openxmlformats-officedocument.theme+xml" PartName="/xl/theme/theme1.xml" />
2) Then I tried to not create new XSSFWorkbook, but: import external XLSX file, change its Theme and save again as XLSX. Then file has informations about Theme, but about original - not changed.
I checked that constructor XSSFWorkbook() creates objects like StylesSource and SharedStringsTable, but not ThemesTable. So maybe it impossible to change Theme after constructor, because in fact it changes nothing?
Any suggestions? Please, help, Ive been trying for 3 days.