Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1075
Print, Page Setup
posted

I need to do some Page Setup before printing, i.e. like paper size, orientation, etc. I tryed to use UltraPrintPreviewDlg - but seems no page setup there. Then I tryed to create my own PageSetupDlg and call it inside grid_InitializePrint but seems too many popups because I also call PrintSetupDlg for setting Titles and Footers there. Is it better to call PageSetupDlg from grid_BeforePrint? Good example of using Page Setup for printing is really appreciated.

Parents
No Data
Reply
  • 1803
    posted

    Hi Klimia,

    You can avoid the extra components and try to use the ultragrid.print() method

    after callin the method grid.print()

    use the initializeprint event and play with the options available,,

     

    Private Sub UltraGrid1_InitializePrint(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelablePrintEventArgs) Handles UltraGrid1.InitializePrint

     

    e.PrintLayout.Bands(0).Override.HeaderPlacement = HeaderPlacement.RepeatOnBreak

    e.DefaultLogicalPageLayoutInfo.PageHeader = "Sample header"

    e.DefaultLogicalPageLayoutInfo.PageFooter = "Sample footer"

    e.PrintDocument.PrinterSettings.DefaultPageSettings.PaperSize

    e.PrintDocument.DefaultPageSettings.Landscape = True

    End Sub

    hppy koding,

    Arun

     

Children