Printing

  • 2 minutes to read

The ASPxSpreadsheet control provides two basic approaches to printing: you can print a document from code using the appropriate API methods and properties, or using the spreadsheet Ribbon UI. Note that the printing command is located in the Common Ribbon page group of the File tab.

The document includes the following sections.

Print a Workbook using the Print Dialog

  • Invoke the Print dialog using the Ribbon UI

    To print a document and set print options, click the Print button in the Common group, or press CTRL+P.

    PrintButton.png

    In the invoked Print dialog box, specify the required settings such as printer name, the number of document copies and the number of pages you wish to print, and click Print.

    PrintDialogNew

Specify Print Options

  • Via the Ribbon UI

    Before printing a workbook, an end-user can specify print settings for each worksheet separately using the Page Layout ribbon tab of the ASPxSpreadsheet control. Use buttons located in the Page Setup group to specify page margins, document orientation, and paper size. To set more specific printout settings (such as print scaling, page order, header and footer options, etc.), click the Margings - Custom Margins... command to invoke the Page Setup dialog.

    PageCustomMargins

    PageLayoutTab

  • In code

    To specify print options, use properties of the WorksheetView object, accessible using the Worksheet.ActiveView property. The WorksheetView enables you to specify general page options such as orientation, margins and paper size settings. More print-specific options can be specified using the properties of the WorksheetPrintOptions object.

See Also