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
115
Grid is too long to print
posted
 hi


im using printpreviewdialog to show grid data.

i have multi level grid which expanded is 2 pages wide (when viewed in portrait). The problem is that when i dont expand the grid it should fit in one page but the print preview still puts it in 2 pages thus every sencond page is empty. I figure it happens because the grid width that is passed to dialog is the width of grid when everything is expanded.

Could someone knows how could i resolve this?

  • 1775
    Verified Answer
    posted

    From my conversation with Infragistics Support

     ==================

    Support:  

    Hello Andrej,

    Our developers have completed their review of development incident
    BR26149. They have determined that this is "Not a Bug" issue for the
    following reasons:

    "There is actually only a single logical page generated in this case,
    though it results in two physical pages for this. The reason is that
    the page sizes are calculated based on the extent of the bands
    (including the child band); this is because we do not loop through each
    row when determining the page sizes for efficiency reasons and having
    only a single expanded row would cause the page to extend beyond the
    width of the first physical page. Moreover, there could be a second
    logical page generated further down the process that *does* have some
    child rows expanded that would extend onto the 2nd physical page, so
    having a blank page as part of the first logical page would make sense
    for someone collating the copies.

    Please refer the structure:

    [LogicalPage #1]
    Page 1 Page 2

    [LogicalPage #2]
    Page 3 Page 4

    There are a couple workarounds for this issue. The first would be to
    hide the child band when printing, such as:

    private void ultraGrid1_InitializePrintPreview(object sender,
    Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e)
    {
    e.PrintLayout.Bands[1].Hidden = true;
    }

    This might not be a viable solution so an alternative would be to force
    each logical page to only have 1 physical page, such as:

    private void ultraGrid1_InitializePrintPreview(object sender,
    Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e)
    {
    e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1;
    } "

    ===========================

    Yours truly 

    I agree with the argumentation of your developers. Could you please make a feature request on my behalf to make the parameter UltraGridPrintDocument .FitWidthToPages configurable from UltraPrintPreviewDialog (either as a textbox or as a checkbox)? It would be probably necessary to move this property up to Infragistics.Win.Printing.UltraPrintDocument.
    =========================== 

    Support:

    Hello Andrej,

    As per your suggestion, I have logged a feature request on your behalf with the following description so that this functionality may be added to a future release. Your reference number for this feature request is FR08062.

    Description: "Customer requires the ability to configure the FitToWidth property of UltraGridPrintDocument control by UltraPrintPreviewDialog as a TextBox or as a CheckBox." 

    ===========================

     

    Concerning feature request: I've never seen (in last 3 years that Infragistics implemented any of our feature requests)... Hm. Wrong. They did publish .pdb files