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

On Save As

edited October 2003 in General
I am writing a custom save procedure. I am able to write code on
ppDesigner1.OnCustomSaveDoc where I proceed to save to database after
prompts, etc. However, this does not effect the report designer behavior if
the user selects File / Save / Save As. Selecting Save As .. creates a
dialog that list all reports, etc.

How can I override the Save As.. behavior to run the OnCustomSaveDoc event
or similar code?

Thanks,
Bob

Comments

  • edited October 2003
    Hi Bob,

    Try using the OnCustomSaveDoc event in the TppDesigner. The Sender object
    in this event is the report with all the save options set up. All you will
    need to do is worry about where you would like your report to be saved.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2003
    I see where the Sender in OnCustomSaveDoc is the ppReport. However, I do
    not understand how to determine if the user selected Save, Save As, or Save
    To File. Since the OnCustomSaveDoc event takes over for each of these, I
    need to know which was selected and proceed accordingly. Can you further
    clearify or provide an example of implementation?

    Thanks,
    Bob


  • edited October 2003
    Hi Bob,

    As far as Save and SaveAs go, the designer treats them almost the same way.
    It checks to see if the file already exists and then saves the report to the
    specified location. You should not have to worry about the difference
    between these two. To see if the user selected Save To File, you will need
    to check the Report.Template.SaveTo property. If this enumerated type is
    "stFile", the user selected Save To File. Check out the ReportBuilder
    source in the ppDsgner.pas file to see how the Report Designer currently
    handles report saving. This will give you a good starting point to creating
    your own.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2003
    That was the piece of information I needed. Works find now.

    Thanks,
    Bob Tucker

This discussion has been closed.