PrintArea and SheetRender(xps)

Hi,


maybe someone can help me, i have a print area on a sheet and export it with the SheetRender to xps and have in the ImageOrPrintOptions the OnlyArea set as false. I expect that the whole sheet is exported to xps and not the print-area but that is not the case.

Thanks in advance,

Willem-Jan

Hi Willem-Jan,

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

You have actually set the print area with this line.

ws.PageSetup.PrintArea = “A1:B1”;

If you remove this line, it will print the entire worksheet in xps. Please note, Aspose.Cells print the same way as it is shown in the Excel Print Preview.

Please comment the above line to resolve your issue.

Thanks for the fast reply.


the problem is that i have an excel sheet with a print area and that is exported to xps (maybe my example isn’t really good), so “i don’t know” that a print-area is set so i used the OnlyArea=false property to be sure the whole sheet is exported. With a workaround i can delete the PrintArea that’s works ofcourse too.

Edit: Added a better example.



Hi Willem-Jan,

Thanks for your posting and using Aspose.Cells.

Your finding is correct. There is no way to print the entire area without clearing the print area first. So you must clear it to make sure the entire contents of worksheet print on the image. I have tested it with your sample file.

OnlyArea is false by default so setting it false does not have any effect. You can add this line to make sure that printing area is set to empty before taking the image of worksheet.

ws.PageSetup.PrintArea = “”;