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

Free Support Forum - aspose.com

Corrupt document produced when setting DataLabels.LinkedSource to null

Hi,


The following code will create a corrupt Excel document on my system:

var workbook = new Workbook();

Worksheet chartSheet = workbook.Worksheets[workbook.Worksheets.Add(SheetType.Chart)];
Worksheet ws = workbook.Worksheets[0];

ws.Cells[“A1”].PutValue(“Products”);
ws.Cells[“B1”].PutValue(“Users”);
ws.Cells[“A2”].PutValue(“Aspose.Cells”);
ws.Cells[“B2”].PutValue(10000);
ws.Cells[“A3”].PutValue(“Aspose.Slides”);
ws.Cells[“B3”].PutValue(8000);
ws.Cells[“A4”].PutValue(“Aspose.Words”);
ws.Cells[“B4”].PutValue(12000);

Chart chart = chartSheet.Charts[chartSheet.Charts.Add(ChartType.Pie, 7, 0, 20, 6)];

Series series = chart.NSeries[chart.NSeries.Add("=Sheet1!$B$2:$B$4", true)];
series.XValues = “=Sheet1!$A$2:$A$4”;

series.DataLabels.LinkedSource = null; // LinkedSource was null already before this.

workbook.Save(“corrupt.xlsx”); // Opening this file in Excel will result in Excel notifying of corruption

var brokenBook = new Workbook(“corrupt.xlsx”); // Exception

Opening the document with Aspose using "new Workbook(“corrupt.xlsx”) results in the following exception:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
at ”..Œ“(€ , Series )
at ”..ŽŒ“(€ , Series )
at ”..˜(€ , Series )
at ”..–(€ , œ )
at ”..‹(€ , Boolean )
at ”..Ÿ(€ )
at ”..ež(€ )
at ”..Read(€ )
at ”..ež(String , Chart )
at ”..()
at ”..Read()
at ”.‡.ƒ( , String )
at ”.‡.ƒ( , String )
at ”.‡.ƒ()
at ”.‡.Read()
at ”.†.(Workbook , LoadOptions )
at Aspose.Cells.Workbook.Ÿ(Stream , LoadOptions , Boolean )
at Aspose.Cells.Workbook.Ÿ(String , LoadOptions )
at Aspose.Cells.Workbook…ctor(String file)


Note that adding the following line after setting LinkedSource will fix it:

series.DataLabels.Text = null; // Text is “”, before this.

This does not seem to make any sense to me.

This is using version 8.3.0.0.

Best regards,

Hi John,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after executing your sample code with the latest version: Aspose.Cells
for .NET v8.3.0.3
. The output document produced after setting DataLabels.LinkedSource to null is corrupt.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once this issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43206 - Corrupt document produced when setting DataLabels.LinkedSource to null

I have also attached the output corrupt workbook generated by the code for a reference.

Hi John,

Thanks for using Aspose.Cells.

We have fixed
this issue now. We will provide you a fix in couple of days after
incorporating other enhancements and fixes and conducting some extensive
testing. Once, it is available for you, we will let you know asap by
posting in this thread.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.3.0.4 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-43206) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.