Spread Windows Forms 17
Spread Windows Forms 17.0 Product Documentation / Developer's Guide / Printing / Displaying Dialogs for Users / Modifying the PageSetup Dialog for the User
In This Topic
    Modifying the PageSetup Dialog for the User
    In This Topic

    Spread.NET provides a way for you to change the printing behavior like Excel and modify the existing options of the PageSetup dialog when the ExcelCompatiblePrinting property is set to true. This property enables the use of images in the header/footer, and rich text such as Superscript and Subscript in the spreadsheet.

    The following image shows the updated options of the PageSetup dialog when the ExcelCompatiblePrinting property is set to true.

     

    This property also does not affect the print page layout unless the Header/Footer is too large in which case the print page's content is overlapped.

    The following image shows the overlapped header content when the ExcelCompatiblePrinting property is set to true.

    Refer to the following code to implement the ExcelCompatiblePrinting property for printing the Spreadsheet.

    C#
    Copy Code
    // Content overlaps with print page
    fpSpread1.Features.ExcelCompatiblePrinting = true;
    fpSpread1.ActiveSheet.Cells[0, 0, 3, 3].Value = 1;
    fpSpread1.Sheets[0].PrintInfo.Header = "/lLine1/nLine2/nLine3/nLine4";
    fpSpread1.Sheets[0].PrintInfo.Preview = true;
    fpSpread1.Sheets[0].PrintInfo.ShowColumnHeader = PrintHeader.Hide;
    fpSpread1.Sheets[0].PrintInfo.ShowRowHeader = PrintHeader.Hide;
    fpSpread1.Sheets[0].PrintInfo.EnhancePreview = true;
    fpSpread1.PrintSheet(0);
    
    VB
    Copy Code
    ' Content overlaps with print page
    FpSpread1.Features.ExcelCompatiblePrinting = True
    FpSpread1.ActiveSheet.Cells(0, 0, 3, 3).Value = 1
    FpSpread1.Sheets(0).PrintInfo.Header = "/lLine1/nLine2/nLine3/nLine4"
    FpSpread1.Sheets(0).PrintInfo.Preview = True
    FpSpread1.Sheets(0).PrintInfo.ShowColumnHeader = PrintHeader.Hide
    FpSpread1.Sheets(0).PrintInfo.ShowRowHeader = PrintHeader.Hide
    FpSpread1.Sheets(0).PrintInfo.EnhancePreview = True
    FpSpread1.PrintSheet(0)
    

    The ExcelCompatiblePrinting property is applicable for Spread.NET v17 and higher.
    Currently, enabling of this property may not produce the same print output as Excel; future versions aim to improve print accuracy and consistency.