in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Fit a LayoutControl on a A4-Page

Last post 9/19/2008 4:55 AM by Alan (Developer Express). 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 9/17/2008 8:08 AM

    Fit a LayoutControl on a A4-Page

    Hello,

    I have a Form containing a LayoutControl, fully docked. Now I want to print the contents of the LayoutControl, filling up one page entirely, using the layout's flexible resize behaviour. Using a PrintingSystem object associated by Link to the LayoutControl allows me to define page orientation, margins and so on, but I have no actual control over how the Layout is rendered in its print version: Either my form is too small in or spans uglily over several pages. It seems to depend on the current dimensions of the form, which actually should be independent from the print version.
    I suppose there must be a quite simple way, I just can't see how. Any hints or suggestions greatly appreciated.

     

    Cheers,
        -Nico.

  • 9/18/2008 8:05 AM In reply to

    Re: Fit a LayoutControl on a A4-Page

    Hello Nico,

    You can use the scaling feature of the PrintingSystem. To achieve the required result in the Print Preview form, you can click on the Scale button, and choose the "Fit to 1 pages wide" option in this dialog.

    To programmatically achieve the same result, use the following code:
    printControl1.ExecCommand(DevExpress.XtraPrinting.PrintingSystemCommand.Scale, new object[ ] { 1 });

    @.
    R&D, .NET Team.

    PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/sc.
    Filed under: ,
  • 9/18/2008 8:40 AM In reply to

    Re: Fit a LayoutControl on a A4-Page

    Hello Alan,

    Thanks for the tip, this is indeed very interesting. I wasn't aware about the ExecCommand method. However, what I'd like is to resize my element so it fits onto my A4 page completely, changing its aspect ratio if necessary. Your code basically zooms until the element's width equals the page's width without really resizing the element on both axis. I tried out some other commands available in the PrintingSystemCommand class, but nothing seems to be appropriate for my problem.

    As workaround, I now temporary change the dimensions of the form the element is docked to, print, and reset the form's dimensions to the original values afterwards. Obviously this process is visible by the user, so I'm still looking for a more elegant solution.

    Thanks again,

       -Nico.

     

  • 9/19/2008 4:55 AM In reply to

    Re: Fit a LayoutControl on a A4-Page

    Hello Nico,

    It seems that in the current XtraLayout version there is no better approach to accomplishing this task than the workaround, which you already use.

    @.
    R&D, .NET Team.

    PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/sc.
Page 1 of 1 (4 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED