Using Aspose.Cells for .Net, I’ve encountered an issue when trying to export the range of cells that make up a pivot table as an SVG image. In the excel spreadsheet the pivot table appears as a pivot table should, with proper formatting of the header, footer, etc. However, when trying to export this (in this case using the sheetRender to render the specific area of the pivot table) I encounter an issue where the exported image appears to be just an unformatted group of cells. To make the issue even more cryptic, if I apply formatting to these cells manually, the formatting shows up in the export, but the formatting given to the cells by the pivot table to not show up in the image export. Any information or guidance on this topic would be greatly appreciated. I’d be happy to provide any further clarification.
You need to calculate and refresh pivot table before rendering to image format. Please call the following methods before instantiating SheetRender object, see the following code segment for your reference:
........... var worksheet = workbook.Worksheets; workbook.CalculateFormula(); var pivotTable = worksheet.PivotTables; pivotTable.RefreshData(); pivotTable.CalculateData(); ......
Hope, this helps a bit.
Solved my issue instantly. Thank you so much.
Good to know that your issue is sorted out by the suggested code segment. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.