ByteArrayOutputStream baos = new ByteArrayOutputStream();
workbook.save(baos, SaveFormat.AUTO);
according to the documentation SaveFormat.AUTO should work as following:
If saving the file to the disk,the file format format accords to the extesion of the file name. If saving the file to the stream, the file format is xlsx.
but instead it generates:
Exception in thread “main” java.lang.NullPointerException
at com.aspose.cells.OoxmlSaveOptions.(Unknown Source)
at com.aspose.cells.FileFormatUtil.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
when changing SaveFormat.AUTO to SaveFormat.XLSX all works fine.
Thanks for your posting and using Aspose.Cells for Java.
We were able to reproduce this exception. It can occur with any source file. We have logged this issue in our database. We will look into it and resolve this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.