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

Previewformcreate Event

edited March 2012 in General
?Not sure if I have this correct. created the event but on preview of
report the event is not fired.
Does this only work with custom preview forms?

What I was hoping to do was set the preview forms caption, or is there
another way of doing it?



--- posted by geoForum on http://www.newswhat.com

Comments

  • edited March 2012
    In my quick testing, the OnPrevewFormCreate event is firing correctly
    and as designed.

    Are you loading templates? If so, you need to be sure to assign this
    event after the template is loaded.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2012
    Yes I am loading templates.

    Why assign it after a template loaded would make a difference?

    But will try it after the template is loaded.

    Thanks



    --- posted by geoForum on http://www.newswhat.com
  • edited March 2012
    Report templates save the entire report definition including event
    references. By loading a template you are essentially clearing out all
    existing event references to the report object and replacing them with
    the references saved with the template. Once the template is loaded,
    you need to re-assign any Delphi event handlers to avoid loosing them.

    A more elegant solution would be to keep all event code local to the
    template using RAP.

    Best Regards,

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