Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

What event to use between preview and print?

edited December 2001 in General
I want to allow users to see a form filled in with data on print preview but
I don't want to actually print the form layout to the printer. In other
words I want them to see on screen a completed form using colour, graphics,
shapes etc, but only actually print the text of the form...

I have experimented with the BeforePrint event trigger and have proven that
I can enable or disable display of certain objects in code - it works
well...

The only problem I have is identifying a consistent event handler that I can
use to trigger the necessary code. Ideally it needs to fire immediately
before printing to the printer - to ensure it works with screen preview
enabled AND disabled. What would you suggest?

Advice gratefully appreciated...

Comments

  • edited December 2001
    Check the device in the OnBeforePrint:
    if ppReport1.DeviceType = 'Printer' then
    Don't print what you need

  • edited December 2001
    Thanks for the suggestion - it is a good idea but it does not work as the
    DeviceType is set to Printer even when doing a screen preview!

    However, have now found that I can do the same from the OnPrintDialogClose,
    which works so thanks for pointing me in the right direction!


    Any other suggestions
This discussion has been closed.