We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Pivot table needs to be repaired after open and save template file with Aspose

Hello,

We are considering adopting Aspose due to its Excel 2007 compatibility. We have a lot of excel templates built with Excel 97-2003. They have extensive usage of macros and pivot tables. I did the following in my test:

1. I opened a template in Excel 2007 and save it with type of Excel Macro-Enabled Template (xltm).
2. A simple test class was used to test the open/save functionality:

WorkbookDesigner designer2007m = new WorkbookDesigner();

// Workbook oldWB = new Workbook();
// oldWB.open(“C:\temp\template07.xltm”, FileFormatType.EXCEL2007XLTM);
// designer2007m.getWorkbook().copy(oldWB);

designer2007m.getWorkbook().open(“C:\temp\template07.xltm”, FileFormatType.EXCEL2007XLTM);
// designer2007m.setDataSource(“MultiVariable”,new String[] {“blah”, “blah1”});
designer2007m.process(false);

designer2007m.save(new FileOutputStream(“C:\temp\template07_aspose.xltm”), FileFormatType.EXCEL2007XLTM);

3. The generated file has less size compared to the original one. When I tried to open it with Excel 2007, it warned that there are unreadable contents and the pivot tables needed to be repaired. It also generated an error log as below:

BODY {
FONT: x-small ‘Verdana’; MARGIN-RIGHT: 1.5em
}
.c {
CURSOR: hand
}
.b {
FONT-WEIGHT: bold; COLOR: red; FONT-FAMILY: ‘Courier New’; TEXT-DECORATION: none
}
.e {
MARGIN-LEFT: 1em; TEXT-INDENT: -1em; MARGIN-RIGHT: 1em
}
.k {
MARGIN-LEFT: 1em; TEXT-INDENT: -1em; MARGIN-RIGHT: 1em
}
.t {
COLOR: #990000
}
.xt {
COLOR: #990099
}
.ns {
COLOR: red
}
.dt {
COLOR: green
}
.m {
COLOR: blue
}
.tx {
FONT-WEIGHT: bold
}
.db {
MARGIN-TOP: 0px; PADDING-LEFT: 0.3em; MARGIN-BOTTOM: 0px; FONT: small Courier; MARGIN-LEFT: 1em; BORDER-LEFT: #cccccc 1px solid; TEXT-INDENT: 0px
}
.di {
FONT: small Courier
}
.d {
COLOR: blue
}
.pi {
COLOR: blue
}
.cb {
MARGIN-TOP: 0px; PADDING-LEFT: 0.3em; MARGIN-BOTTOM: 0px; FONT: small Courier; MARGIN-LEFT: 1em; COLOR: #888888; TEXT-INDENT: 0px
}
.ci {
FONT: small Courier; COLOR: #888888
}
PRE {
DISPLAY: inline; MARGIN: 0px
}

<?xml
version=“1.0” encoding=“UTF-8” standalone=“yes”
?>
- <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error035640_01.xml</logFileName>
- <repairedRecords summary="Following is a list of repairs:">
<repairedRecord>Repaired Records: PivotTable report from /xl/pivotTables/pivotTable1.xml part (PivotTable view)</repairedRecord>
<repairedRecord>Repaired Records: PivotTable report from /xl/pivotTables/pivotTable2.xml part (PivotTable view)</repairedRecord>
<repairedRecord>Repaired Records: PivotTable report from /xl/pivotTables/pivotTable3.xml part (PivotTable view)</repairedRecord>
</repairedRecords>
</recoveryLog>

I have read other posts on aspose website and it was claimed that open/save excel files with pivot tables are supported by Aspose. Please help me identify if it is any problem with our template or it's a limitation of Aspose?

Attached please find the original and the saved templates.

Thanks,
Michelle


Hi Michelle,

Please try the attached version as we have fixed the issue.

Thank you.

Hi Amjad,

I tested the attached Aspose library and the pivot table issue was resolved. Thanks for the quick turnaround!

I have some more questions here:

1. I still noticed the generated file size is smaller than the original one (68 kb vs 73 kb), what could cause the size loss?
2. When will the new library be available for downloading officially?

Thanks,
Michelle

Hi,

Thanks for your further inquiries.

1. I still noticed the generated file size is smaller than the original one (68 kb vs 73 kb), what could cause the size loss?

We will explain you later.


2. When will the new library be available for downloading officially?

Well, you may use the fix without any problem (as long as you wish), it 's just like an official release. We normally provide bug fixes in the forums for the users which they use without any problem. However, our next official release of the component will include all the functionality of the previous fixes. Once we finish our tasks list (the list includes some enhancement over existing features, new features, bug fixes etc.) with extended testing, we will release our next official release of the product.

Thank you.

Hi,

1. I still noticed the generated file size is smaller than the original one (68 kb vs 73 kb), what could cause the size loss?

Regarding the file size generated by Aspose.Cells, well, it is not an exact copy of the original one, something in the original file that has no influence on the workbook's data and other attributes can be skipped and not necessarily written to the resultant file. For example, we check the standard color palette and if it does not make any difference / influence writing it with the resultant file for the final workbook. So, consequently, we do not write it to the generated file. And there are some other things which might cause the file size changed and yet has no effect on Workbook's contents, such as, the format of writing XML node, some namesapces which are not used any more, and so on.
Hope, you understand now.
Thank you.