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

Free Support Forum - aspose.com

Print entire width of worksheet on one page

Hi,

I have read in your Wiki about setting print options. A customer who has been using a competitor's website is complaining about how our spreadseets must be formatted by hand once they are downloaded so that the first worksheet (Summary Page) automatically prints in landscape and fits (width-wise) on one printed sheet. It is okay if it has to print several pages to get all the data vertically, but the sheet MUST print on a single page width-wise. I can't find your instructions for sending that Print Layout info on a sheet-by-sheet basis. Then the following Detail sheets must print in Portrait mode and again fit width-wise on a single page.

I will send you 2 examples that contain essentailly the same data and layout as they appear in Excel. I used the competitor's layout as templates, so they are nearly identical.

The first upload will be the file that we are outputing from our site with Aspose Cells. It does NOT print correctly. It is called Aspose.xls.

I will follow up in my next post with our competitor's product spreadsheet called Competitor.xls. That one prints correctly as soon as it is downloaded.

In Excel they both look very similar, but Aspose.xls prints poorly and Competitor.xls prints correctly.

This is Very important for us to fix. If we cannot fix it we will lose many customers. Please tell me what I need to do to fix the print layout properties for each worksheet (using Aspose code) while I am creating the document.

Thank you

Here is the Competitor's workbook that prints excatly the way we want our workbook to print. The first worksheet (Summary) prints in Landscape with the entire width fitting on a single page.

The detail workseets print in Portrait with the entire width printing on one page.

We must make out Aspose worksheets behave the same way or we will lose our first customer before Christmas. That would no be a good oresent for us.

Thank you...

Hi,

Thanks for considering Aspose.

I think you may try some APIs for your desired printing options:

1). For setting page orientation to landscape, you may try:

//Setting the orientation to Landscape

worksheet.PageSetup.Orientation = PageOrientationType.Landscape;

2). For setting scalling factor:

//Setting the scaling factor to 67 percent

worksheet.PageSetup.Zoom = 67;

3). For setting fitting pages wide:

//Setting the number of pages to which the width of the worksheet will be spanned
worksheet.PageSetup.FitToPagesWide = 1;

4). For setting paper size:

worksheet.PageSetup.PaperSize = PaperSizeType.PaperLetter;

5). For setting print quality:

//Setting the print quality of the worksheet to 600 dpi
worksheet.PageSetup.PrintQuality = 600;

Further kindly check some wiki docs for your reference:

http://www.aspose.com/Wiki/default.aspx/Aspose.Cells/SettingMargins.html

http://www.aspose.com/Wiki/default.aspx/Aspose.Cells/SettingPrintOptions.html

http://www.aspose.com/Wiki/default.aspx/Aspose.Cells/SettingPageOption.html

Thank you.