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

Free Support Forum - aspose.com

Pivot table formatting not in printed hardcopy

Hi,

We are looked to call the WorkbookRender.ToPrinter() method to print a workbook without the need to create the actual file. We came across an issue with the formatting of the printed pivot table; the pivot table does not seem to have any formatting in the printed copy.

I have attached a small project to demonstrate the issue. I have also attached an input file “input file to test print.xlsx” containing a pivot table with some formatting. Running the project will show a text box for you to enter the file location of the input file, and a combo box (hopefully; depending whether the project has rights to view your printers list) listing your available printers. The input file only has a the pivot table as the only visible worksheet and the pivot table itself is quite small.

Is there a setting I am missing that will allow the pivot table’s format to be visible in the printer copy?

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

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

This issue has been logged as CELLSNET-41877.

Hi,


Please add the following two lines to your codes before rendering to Printer.
e.g
//…
Workbook wb = new Workbook(fileLocation);

wb.Worksheets[“Report”].PivotTables[0].RefreshData();
wb.Worksheets[“Report”].PivotTables[0].CalculateData();

Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
options.ImageFormat = ImageFormat.Jpeg;
options.PrintingPage = PrintingPageType.Default;

WorkbookRender wr = new WorkbookRender(wb, options);
//…