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

Report.Modified is not working.

edited June 2003 in End User
Hi,
However much I tried, I was unable to force save dialog popup. The property
that you said I should set to true for that purpose Report.Modified is not
working. I tried to put it in the Template.OnLoadEnd and Template.OnNew
events, but it still didn't work.
Setting it to either true or false doesn't affect report behaviour at all.

What should I do?

Thanks,
MB.

Comments

  • edited June 2003
    It works for me. I assign the Report.Template.OnLoadEnd event and then check
    to see if the report is modified when shutting down the form. I load a
    report template using the designer component at runtime with this code.

    procedure TForm1.ppDesigner1CloseQuery(Sender: TObject; var CanClose:
    Boolean);
    begin
    if (ppReport1.Modified) and (Application.MessageBox('Save this report',
    '', MB_YESNO) = IDYES) then
    ppReport1.Template.SaveToFile;
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ppDesigner1.ShowModal;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    ppReport1.Template.OnLoadEnd := LoadendEvent;
    end;

    procedure TForm1.LoadEndEvent(Sender: TObject);
    begin
    ppReport1.Modified := {Pick True or False to test};
    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited June 2003
    It is not working. Seems like Report.Modified property is always = false in
    my case.
    But, thanks to the example, I can see a workaround now. It is to use
    OnCloseQuery event and global variables.
    Thanks for the help.

This discussion has been closed.