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

Free Support Forum - aspose.com

Pivot Tables Rendering


Is there any way to render pivot tables to bmp or pdf?
I've created a pivot table using the example http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/create-pivot-tables-and-pivot-charts.html and it opens fine in excel. However when I change the last line from:
workbook.Save("pivotTable_test2.pdf", Aspose.Cells.SaveFormat.Pdf);
the PDF file created only has the 1st sheet (the raw data).
I've also tried using the SheetRenderer to render as bmp but that also fails to find anything on the Pivot Table sheet.

Thanks in advance,

Hi Eytanes,

We are unable to reproduce the issue mentioned by you. Please use the attached latest version Aspsoe.Cells5.1.4.5. We are sending you the Excel file that contains the pivot table and the output pdf file for your consideration. If you face any difficulty, please feel free to contact us.

Following code snippet has been used to generate the output.

string inputName = @"C:\\excelTrash\\pivot.xlsx";
string outputName = @"C:\\excelTrash\\pivot_output";
ImageOrPrintOptions outputOptions = new ImageOrPrintOptions();
outputOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Bmp;
Workbook book = new Workbook(inputName);
Worksheet objworksheet = book.Worksheets["Sheet2"];
Aspose.Cells.Rendering.SheetRender sheetRender = new Aspose.Cells.Rendering.SheetRender(objworksheet, outputOptions);
sheetRender.ToImage(0, outputName);
Workbook book = new Workbook(inputName);
book.Save(outputName, SaveFormat.Pdf);