I am using Aspose.Cells 8.6.2.6 version.
I have an Excel file with pivot chart. All I am doing is opening the file and saving as a new file.
It is not preserving formatting on the file.
When I add below lines, it formattes it totally differently.
Please see attached input file (template) and two outputs
Workbook wb = new Workbook(sTemplate);
String sOutputFileName = “Output_no_calculate.xls”;
Aspose.Cells.Charts.ChartCollection chartCollection = sheet.Charts;
if (chartCollection != null && chartCollection.Count > 0)
{
foreach (Aspose.Cells.Charts.Chart chart in chartCollection)
{
chart.Calculate(); // tried with and without this.
}
}
wb.Save(sOutputFolder + @"" + sOutputFileName, SaveFormat.Excel97To2003);
Hi,
Sample code:
Workbook wb = new Workbook(“e:\test2\RollingVaRReport-template.xlsx”);
wb.Save(“e:\test2\out1.xls”, SaveFormat.Excel97To2003);
thanks for your quick response. I am now saving in same format and the issue doesnt happen. So I am good for now.
Hi,
Hi,
formatting and settings will not be same as source file. If you think the
result with calculate() is fine (or provide details for differences when calling Chart.Calculate() method), we might provide you a fix that could call chart.Calculate() method automatically before converting XLSX to XLS in Workbook.Save() method.