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

Free Support Forum - aspose.com

Aspose.Cells Chart looses formatting of labels after workbook.Copy

Please see the attached file and the script below that produces an EMF file (similar issue is observed for PDF) with a chart where labels are rendered as numbers while dates are expected. If the copy workbook block is removed, the issues is not observed:


var wb = new Workbook(GetFullPath(“sample.xlsx”));
wb.CalculateFormula();
var pt = wb.Worksheets[1].PivotTables[0];
pt.RefreshData();
pt.CalculateData();
var chart = wb.Worksheets[0].Charts[0];
chart.RefreshPivotData();
chart.Calculate();

var _wb = wb; // copy workbook block
wb = new Workbook();
wb.Copy(_wb);

wb.Worksheets[0].Charts[0].ToImage(GetFullPath(“chart.emf”), ImageFormat.Emf);

Hi,


Thanks for your posting and using Aspose.Cells.

We were able to observe this issue by testing it with the following sample code with your source excel file and logged it in our database for a fix. This issue has been logged as

  • CELLSNET-45097 - Chart loses formatting of labels after Workbook.Copy

I have also attached the output image for a reference.

C#
var wb = new Workbook(“sample.xlsx”);
wb.CalculateFormula();
var pt = wb.Worksheets[1].PivotTables[0];
pt.RefreshData();
pt.CalculateData();
var chart = wb.Worksheets[0].Charts[0];
chart.RefreshPivotData();
chart.Calculate();

var _wb = wb; // copy workbook block
wb = new Workbook();
wb.Copy(_wb);
wb.CopyTheme(_wb);

wb.Worksheets[0].Charts[0].ToImage(“output-chart.jpg”, ImageFormat.Jpeg);

Hi Dmitry,


This is to inform you that the ticket logged earlier as CELLSNET-45097 has been marked resolved. We will shortly share the fix here for your testing.
Hi,

Thanks for using Aspose.Cells.

Please download and try the following latest fix

Aspose.Cells for .NET v17.1.10 (.NET 2.0) compiled in .NET Framework 2.0.
Aspose.Cells for .NET v17.1.10 (.NET 4.0) compiled in .NET Framework 4.0.

and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-45097) have been fixed in Aspose.Cells for .NET 17.2.0.


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

Thanks, the fix works for me.

Hi Dmitry,


Thank you for the confirmation. It is good to know that you are up & running again. Please feel free to contact us back in case you need our further assistance with Aspose APIs.

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