Ticket Q237147
Visible to All Users

Get/Set PageSettings and PrinterSettings to XtraReports reconized by preview and print

created 15 years ago

Hello!
I want to provide the ability to allow pagesetup for customers using
PrintingSystem.PageSetup()
after that iam able to get all page info on this dialog but not the papersource and the printername
How can i determine printer name and papersource without actually printing something.
I want to provide some preconfiguration and to save settings th euser is able to make.
br
roland

Show previous comments (5)
Alessandro (DevExpress Support) 15 years ago

    Hello Roland,
    Thank you for the code snippet. Your approach seem to be quite correct. As for you questions:
    1, 2) When a report document is generated the PritingSystem is recreated once again (or created if the report document is generated for the first time). That's why the XtraReport instance property values are mapped to the corresponding PrintingSystem instance property values (Landscape, PaperKind, PrinterName, etc.). Thus, settings applied to the PrintingSystem are not reflected in Print Preview. You should configure the necessary settings on the XtraReport basis. Then call the XtraReport.CreateDocument() (or XtraReport.ShowPreviewDialog() if the report document is generated for the first time). In this scenario your settings will take effect.
    3, 4) The standard approach to accomplishing this task in the XtraPrinting Library is to handle the XtraReport.PrintingSystem.StartPrint event and adjust all necessary printing settings based on your requirements. I suggest that you review the How to dynamically select the paper source and set the printer resolution example, demonstrating this approach in action. I hope you'll find this information helpful.
    Thanks,
    Alessandro.

    ?
    Unknown 15 years ago

      Hi
      attached a testproject
      now i have the problem jthat im able to save/load printersettings and pagesettings.
      im able to show a preview properly (no in my real prject im not using show preview)
      im NOT able to print with theese settings.
      button 1 prints a two page report (actually does nothing to pagesettings)
      button 2 prints a one page empty report.
      Whats the problem here with printing?
      This is URGENT and i think it should be possible to apply page and printersettings and then actually print the report properly.
      br
      roland

      ?
      Unknown 15 years ago

        Hi!
        I finally figured it out how to acomplish this task (mostly by trying all possiblities).
        Now im using the startprint event as i found no other posibility.
        .Net PageSettings and PrinterSettings are not XML Serializable so i wrote a wrapper.
        Attached a working solution.
        A documentation when the printingsystem is reset and a posiblity to set PrintSettings and PageSettings as a reports property which is then recognized in preview, export and print would be nice.
        br
        roland
        sorry for the harsh tone yesterday

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.