Hello,
We are having some problems with the way Aspose.Cells (v7.3.0) handles worksheet Custom Properties at save time.
The attached files:
- test.xls: this is an Excel 2003 workbook containing an worksheet that has Custom Properties generated by a 3rd party Excel Addin.
- test-MsExcel.xlsx: this is the “test.xls” workbook saved to xlsx using Ms Excel 2007. This contains correct Custom Property values.
- test-Aspose.xlsx: this is the “test.xls” workbook saved to xlsx using Aspose.Cells. The binary values of the Custom Properties have been altered and the 3rd party Addin crashed when tries to read these.
The code used to save to xlsx:
var workbook1 = new Workbook(“test.xls”);
workbook1.Save(“test-Aspose.xlsx”, SaveFormat.Xlsx);
Note: The same issue happens when saving to Excel 2003 format using Aspose.Cells.
Aspose should handle the Custom Property values as black boxes, preserving the exact binary value as in the original workbook.
Thank you,
Bogdan Rusu.
IBM Romania.
Hi,
Hi Adrian,
Hello,
There are two custom properties that get corrupted: “COR_Report” and “COR_ResultSet”.
Regards.
Bogdan Rusu.
Hi,ibmromania:Hello,
There are two custom properties that get corrupted: "COR_Report" and "COR_ResultSet".
Regards.
Bogdan Rusu.
I am unable to find any custom property as mentioned by you except there is one property with the name: EBOID.
Please see the screenshot below.
Hello,
I was referring to the Worksheet Custom Properties, these can be found on the worksheet:
var workbook = new Workbook(“test.xlsx”);
var worksheet = workbook.Worksheets[0];
var customProperties = worksheet.CustomProperties;
Regards,
Bogdan Rusu.
Hi Adrian,
Hi,ibmromania:Hello,
I was referring to the Worksheet Custom Properties, these can be found on the worksheet:var workbook = new Workbook("test.xlsx"); var worksheet = workbook.Worksheets[0]; var customProperties = worksheet.CustomProperties;
Regards,
Bogdan Rusu.
Thanks for your sample code.
I have tested your mentioned custom properties and found they are equal both in actual and saved file.
I have tested it using the latest version: Aspose.Cells for .NET v7.3.0.1 Please download and use it.
C#
Workbook workbook = new Workbook(filePath);
var o1 = workbook.Worksheets[0];
workbook.Save(filePath + ".out.xlsx", SaveFormat.Xlsx);
workbook = new Workbook(filePath + ".out.xlsx");
var o2 = workbook.Worksheets[0];
if (o1.CustomProperties["COR_Report"].Value == o2.CustomProperties["COR_Report"].Value)
{
Console.WriteLine("COR_Report is equal in both files.");
}
if (o1.CustomProperties["COR_ResultSet"].Value == o2.CustomProperties["COR_ResultSet"].Value)
{
Console.WriteLine("COR_ResultSet is equal in both files.");
}
Hello,
I’ve verified your code and it works well, but he problem can be observed when comparing the xlsx file created by Aspose (“test-Aspose.xlsx” OR “test.xls.out.xlsx” as in your sample code) and the xlsx file created by Excel 2007 (“test-MsExcel.xlsx”).
I’ve modified your sample code to compare these files:
// “test-MsExcel.xlsx” is the “test.xls” file saved to xlsx using Excel 2007
var excelWorkbook = new Workbook(@“C:\Users\IBM_ADMIN\desktop\test-MsExcel.xlsx”);
var o1 = excelWorkbook.Worksheets[0];<span style="color:#2b91af;">String</span> filePath = <span style="color:#a31515;">@"C:\Users\IBM_ADMIN\desktop\test.xls"</span>; <span style="color:#2b91af;">Workbook</span> workbook = <span style="color:blue;">new</span> <span style="color:#2b91af;">Workbook</span>(filePath); workbook.Save(filePath + <span style="color:#a31515;">".out.xlsx"</span>, <span style="color:#2b91af;">SaveFormat</span>.Xlsx); workbook = <span style="color:blue;">new</span> <span style="color:#2b91af;">Workbook</span>(filePath + <span style="color:#a31515;">".out.xlsx"</span>); <span style="color:blue;">var</span> o2 = workbook.Worksheets[0]; <span style="color:blue;">if</span> (o1.CustomProperties[<span style="color:#a31515;">"COR_Report"</span>].Value == o2.CustomProperties[<span style="color:#a31515;">"COR_Report"</span>].Value) { <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"COR_Report is equal in both files."</span>); } <span style="color:blue;">if</span> (o1.CustomProperties[<span style="color:#a31515;">"COR_ResultSet"</span>].Value == o2.CustomProperties[<span style="color:#a31515;">"COR_ResultSet"</span>].Value) { <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"COR_ResultSet is equal in both files."</span>); }</pre>Running the code you will notice that the values are not the same. As stated in my original post Aspose.Cells should not change the <b>binary</b> values of the existing Custom Properties.<br><br>Thank you,<br>Bogdan Rusu.<br><br><br>
Hi Adrian,
Hi,
Thanks for using Aspose.Cells.
Please download and try this fix: Aspose.Cells for .NET v7.3.0.2 and let us know your feedback.
Hello,
I’ve verified the fixed version by saving to xls/xlsx and works correctly.
Thank you for your quick response,
Bogdan Rusu,
IBM Romania.
Hi,
Thanks for your feedback.
Please feel free to post if you face any other issue relating to Aspose.Cells for .NET, we will be glad to help you.
The issues you have found earlier (filed as CELLSNET-40886) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.