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

Report.SaveAsTemplate broken when set in Designer OnActivate event in RB 20

In the Designer OnActivate event, I have the following line: ppRepFormsLetters.SaveAsTemplate:=true;

For many years now, when closing the designer, this used to make all reports prompt to save changes if any modifications were done. Now this no longer works. The SaveAsTemplate property does not get set. I would like to get the save changes prompt back. Is there a new place to set this property when the report loads into the designer?

Comments

  • Further testing shows me that when the designer first opens and loads the selected report, it does set the Report SaveAsTemplate property to true. But after that report loads, if I open another report from within the designer, then the SaveAsTemplate property is not set. What event can I use to make sure all reports loaded get the SaveAsTemplate property to true? My goal is to make sure that when a user goes to exit the designer, he does not lose all the modifications because he forgot to save it.
  • Hi David,

    This works as in prior versions. Report.SaveAsTemplate is saved as part of the report definition (like all published properties).

    You can implement the Report.Template.OnLoadEnd event to set default values, such SaveAsTemplate True. This is a public event, therefore the event-handler must be assigned in code. See the Demos\EndUser\Report Explorer demo for an example. (Demos are installed to Public Documents\RBuilder\Delphi x\Demos)


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
Sign In or Register to comment.