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
1140
UltraGrid Print Features
posted

Hi,

Can anybody explain whether Is there a way to print the Grid by AutoSizing itself. Right now I am using Crystal Reports but it will not autosize the content based on the paper size of the printer. I want something which shrinks the data based on paper size of the printer and then print.

If so ultraGrid has this functionality, also help me in telling me how to include header and footer like we do in crystal reports.

If it does not, let me know if any of the softwares or report viewers provide me with this functionality

 

Parents
  • 469350
    Offline posted

    Yes, the grid does this.

    You can call the Print or PrintPreview method on the grid and then handle the appropriate event: InitializePrint or InitializePrintPreview respectively.

    To get the grid to fit within a single page, you use the FitWidthToPages property on the DefaultLogicalPageInfo. This object also has properties for the page header and footer.


            private void ultraGrid1_InitializePrintPreview(object sender, CancelablePrintPreviewEventArgs e)
            {
                e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1;
                e.DefaultLogicalPageLayoutInfo.PageHeader = "Header";
                e.DefaultLogicalPageLayoutInfo.PageFooter = "Footer";
            }

Reply Children