Home End User

Saving to Stream and Handling the close method....

edited January 2003 in End User
Hi,
I am trying to set up a ReportDesigned that loads and saves it's report to a
stream. I have the loading and saving methods working the way that I want,
but I have one problem. This is the senario: A user opens a report. The
report gets loaded from a stream. The user makes a change or two. The use
decides to close the Report Designer with the Close button. At this point
the File Has Changed... dialog show up. The users say 'Yes'. This brings
up the Windows Save dialog. This will confuse the user, as the data will be
saved to a stream, not the file.

Is there any way around this behavior?

Thanks,
- David Scheidt
Security Information Systems

Comments

  • edited January 2003
    Where does the stream go? If not to file, then it is going to a blob field
    in a database? If you run the report explorer demos, you'll see that it
    simply shows the save option when closing and does not show the save to file
    dialog. Are you using the designer in a stand alone setup without the report
    explorer? You should set the Report.Template.SaveTo to stDatabase in that
    case.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2003
    The stream is going to a database field that is on a Server. Basically, I
    have a remote app that is sending the stream to the client application. The
    client app then displays the Editor. The user can make changes to the
    report, then the report is sent back to the server. The end user client app
    does not use the report explorer.

    When the end-user designer is loaded, the report is loaded with
    LoadFromStream. The designer then calls the report 'New Report'. Even just
    closing the report makes the designer want to save the changes.

    I tried setting the Report.Template.SaveTo to stDatabase, but that tries to
    bring up the Save To Database Dialog, so that didn't work.

    Thanks for your help,
    - David Scheidt
    Security Information Systems
  • edited February 2003
    ----------------------------------------------------
    Tech Tip: Using the Designer OnCustomOpenDoc and
    OnCustomSaveDoc events
    ----------------------------------------------------

    The Designer OnCustomOpenDoc and OnCustomSaveDoc events can be used to
    control the loading and saving of reports. For example, you may want to add
    a security feature which does not allow the user to load certain reports.

    When the OnCustomOpenDoc, OnCustomSaveDoc events are assigned, the
    report designer will not save or load any reports - it will instead fire
    the events and your event-handler code will be responsible for taking
    the proper action.

    For example, in ppDsgner.pas there is a method called
    TppDesignerWindow.LoadTemplate that contains the following statement:


    if Assigned(FOnCustomOpenDoc) then
    FOnCustomOpenDoc(Self)
    else
    aReport.Template.Load;


    Note that in the above statement, the Report.Template settings will
    contain the name of the report that is to be loaded etc.

    Likewise the TppDesignerWindow.SaveTemplate method contains the
    following:


    if Assigned(FOnCustomSaveDoc) then
    FOnCustomSaveDoc(Self)
    else
    aReport.Template.Save;




    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.