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

TppDesigner, need to know when user selects new report, or loads from file

edited December 2002 in End User
I want to make sure the user gets a chance to save reports before loading
others...

Say the user makes some changes to a report, then clicks File | Load from
file. Before Load from file reads in the new report I want to make sure the
user has a chance to save changes. Likewise for File | New, File | Open.

I couldn't find an event that would let me trap this. Is there one?

Comments

  • edited December 2002
    Try setting Report.SaveAsTemplate to true. This should cause the report
    designer to ask the user if it should be saved before loading a report.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    That works for all except the File | New... menu option. In that case, I am
    not asked first if I want to save changes, even though I've made changes to
    the current report. For now I will remove that choice from the end-user
    designer. Maybe you can add the processing to File | New... to be like File
    | New Report in terms of giving the user a change to save a modified report
    before the new report is created?

  • edited December 2002
    Use the TppDesigner.OnCreateReport event to add a check in your code to see
    if the user wants to save before creating a new report. BTW-The save
    validation happens after the report wizard runs and before the resulting
    report layout is created from the wizard.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    If I click File | New..., then select Report, I am not asked if I want to
    save changes to the current report, a new empty report is created, and my
    changes are lost without warning. If I click File | New Report, I am asked
    if I want to save my changes.

    The Report Wizard under File | New... also does not ask, and my changes are
    lost without warning. Maybe I am doing something different than you, but
    there is no save validation when I select File | New....

    I have SaveAsTemplate = true.

  • edited December 2002
    What must be happening is that the SaveAsTemplate property is set to False
    in the template, but true on the report. Try saving the template with
    SaveAsTemplate set to True. You can also try to enforce the property setting
    in the Report.Template.OnLoadEnd event and the OnSaveStart event so that the
    property is always set to true when streaming down and up to file/database.
    The SaveAsTemplate proeprty setting should force the save query dialog to
    show.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.