Free Support Forum - aspose.com

Pivot table data lose in file opening

hi

we are using the following code to download xlsx file which is generated by aspose.

<%@ page import=“java.io.*” %>


<% BufferedInputStream filein = null;
BufferedOutputStream outputs = null;
try { File file = new File(“D:\Summary Balances Report_1008404_537.xlsx”);
//specify the file path
byte b[] = new byte[2048];
int len = 0;
filein = new BufferedInputStream(new FileInputStream(file));
outputs = new BufferedOutputStream(response.getOutputStream());
response.setHeader(“Content-Length”, “”+file.length());
response.setContentType(“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8”);
response.setHeader(“Content-Disposition”,“attachment;filename=Backup.xlsx”);
response.setHeader(“Content-Transfer-Encoding”, “binary”);
while ((len = filein.read(b)) > 0)
{ outputs.write(b, 0, len); outputs.flush(); } }
catch(Exception e){ out.println(e); } %>


if the file is save to disk working fine.

when we trying to open the file pivot table data lose in file.
it happens only in IE.


please find the attachment for input file.


Hi,

Could you try to change the line of code (if it works fine) i.e.:
response.setHeader(“Content-Disposition”,“attachment;filename=Backup.xlsx”);
to:
response.setHeader(“Content-Disposition”,“inline;filename=Backup.xlsx”);


Thank you.

hi

thanks for your response we change the setHeader but we did not get result.

we find some interesting things.

we generated xlsx file.
b.xlsx
we open the b.xlsx file and save back to the disk with c.xlsx.
the file size increases.
now we are trying to download both files.

the c.xlsx shows pivot table data in open
but it fails in case b.xlsx files.


please find the attachments.

i think the pivot table generation is problem . we are using lightcelldataprovider to generate large files.

hi

we are trying to download the xlsx file by using the code.

<%@ page import=“com.aspose.cells.*”%>
<%
response.setContentType(“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8”);
response.setHeader(“Content-Disposition”,“attachment;filename=Backup.xlsx”);
Workbook readWorkBook = new Workbook();
String filePath=“D:\jdev11i\jdev9\jdevhome\jdev\myhtml\OA_HTML\eisrs\tmp\EIS Modules Installed_1008404_4.xlsx”;
FileInputStream fstream = new FileInputStream(filePath);
readWorkBook.getOpenOptions().setEncoding(“UTF-8”);
readWorkBook.open(fstream,FileFormatType.XLSX);
readWorkBook.save(response.getOutputStream());
%>

we are getting the following error

Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
Removed Part: /xl/pivotTables/pivotTable2.xml part with XML error. (PivotTable view) Load error. Line 1, column 1704.
Removed Records: Workbook properties from /xl/workbook.xml part (Workbook)

please find the attached input file.

Thanks & Regards,

Ranjith.

Hi,


We have just released Aspose.Cells JAVA v2.5.4. Please test your scenario with this version and feedback us. Thank you

hi

we tested with your latest jar.

we still getting the error messages.


Thanks & regards
Ranjith.

Hi,

We are sorry, your problem is still unresolved. We have forwarded it to our development team and also logged this issue. We will update you asap.

This issue has been logged as CELLSJAVA-27953.

Hi,

It should not be the issue of Aspose.Cells. As you have said, the file works fine if it is saved to disk.

For a workbook, we will create the identical resultant file data no matter what is the destination (file or web stream). You can create the same excel file in Ms Excel manually instead of using Aspose.Cells to test whether your jsp file can work fine.

If the file generated by Ms Excel can work but the one of Aspose.Cells cannot, please send us two files and we will look into it.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan