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

Saving Preview Screen Size and Location To Inifile

edited May 2012 in General
I'd like to uses an ini file to keep track of the last used size and
location of the print preview window.

When the print preview window displays I'd like to read the inifile and
set the Top, Left, Width, Height & WindowState and then have the print
preview window uses those values. When the print preview window closes,
I'd like to save the Top, Left, Width, Height and WindowState to the
inifile.

I use the OnShow and OnClose events to accomplish this for the main
form of my application. However, these events are not available on the
ppReport1 object.

What is your recommendation for setting and saving the Top, Left,
Width, Height & WindowState of the print preview window?


--
Michael Riley
GySgt USMC Retired
http://capecodgunny.blogspot.com/

Comments

  • edited May 2012
    Hi Michael,

    The preview form can be accessed using the Report.PreviewForm property.
    If for instance you would like to alter the size or position of the
    preview form, you could assign the PreviewForm.OnShow event inside the
    Report.OnPreviewFormCreate event.

    Note that for position, the default Position property of the preview
    form is poFormCenter. This would need to be changed.

    The best way to alter the behavior of the preview form is to create a
    custom previewer.

    http://www.digital-metaphors.com/rbWiki/Plugins/Dialogs/Preview_Plugin

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.