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

Clear Report Template

edited March 2007 in General
After loading a report template from a database I want the user to be
able to be aboe to run the report again, but using the defaut report
compiled into the .exe rather then the template. However, once the user
loads the template once, I can change templates but I cannot figure
out how to get the default report (compiled into .exe) back without
closing the form and opening it again.

I set all the Report.Template props to '' but that does not work. It
still runs the last template loaded or a new tempplate if the user
selects it. Thnaks.

--
David Farrell-Garcia
Whidbey Island Software, LLC

Comments

  • edited March 2007

    - in the OnCreate event of the form, add some code to save the report
    definition to a memory stream.

    example:

    FReportStream := TMemroyStream.Create;

    myReport.Template.SaveToStream(FReportStream);


    - to restore the report at a later time....

    FReportStream.Position := 0;
    myReport.Template.LoadFromStream(FReportStream);


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2007
    Nard Moseley (Digital Metaphors) wrote:


    That worked perfectly Nard. Thank you.

    --
    David Farrell-Garcia
    Whidbey Island Software, LLC
This discussion has been closed.