I have a requirement where I have to create a zip from the Excel files.
Now I am doing by writing the documents to ZipOutputStream.
But I need to do some operations on those Excel(workbook) using aspose cells and write those files again to ZIP.
I have ByteArrayOutputStream and ZipOutputStream where the content is getting written.
I have to do some operations on each excel docs using aspose cells and then again write these document to zipoutputstream so that I can get all these docs in zipped manner.
Aspose.Cells is an Excel spreadsheet management (create, manipulate, render, print MS Excel file formats and other formats) API, so your task is out of scope/context. May be you could use Aspose.ZIP API for your requirements.
What kind of excel files are you using for those operations? If they are files such as xlsx, xlsb, ods, …etc., those file formats are zip format already and you do not need to zip them again. However, if you do need write a workbook to your own ZipOutputStream, no matter they are zip format or not, it is still feasible. The code example:
Workbook wb = new Workbook(...);
//your operations on the workbook
...
//build your own zip stream
ZipOutputStream zos = new ZipOutputStream(...);
//put the entry for the generated excel file
zos.putNextEntry(new ZipEntry("res.xlsx"));
//save workbook to the zip stream
wb.save(zos, FileFormatType.XLSX);
zos.close();
...
Hope that helps a bit and if you have any other issue we will be glad to provide assistance.
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.
Enables storage, such as cookies, related to analytics.
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.