Ticket Q290603
Visible to All Users

OnBeforePrint Interception

created 14 years ago

Hi,
we have a requirement where we need to carry out certain actions (update database, reload data) before a report is printed to a printer.
OnBeforePrint fires before the report is being generated, e.g. when preview is being generated, but not when printed afterwards.
Using a PrintingSystem.CommandHandler for the print command doesn't help either, because it is invoked BEFORE the print dialog is shown. Thus, when the user cancels out of the print dialog, the report is not printed.
We need to capture an event that occurs just after the user pressed OK in the print dialog.
How can we accomplish this task?
Thanks,
Matthias

Show previous comments (10)
DevExpress Support Team 14 years ago

    Martin,
    Thank you for posting the code snippet. An extra PageSettings.Assign method in the BeforePrint event seems unnecessary (since the report's page settings are already initialized in the BeforePrint event). To convert report units at runtime, you may use the XRConvert.Convert method. Other than that, if you notice any problem with your code, please feel free to update this thread.
    Thanks,
    Alex

      Alex,
      thanks very much for your assistance!
      M

      DevExpress Support Team 14 years ago

        Dear Martin,
        Please feel free to contact us if you have any further difficulties. We will do our best to help you.
        Thanks,
        Alex

        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.