Notify on changing a report's design
Hi everyone,
I'd like to ask the End-User for saving a report's design. The dialog is
situated in the report's close events. My problem is, that I don't know
whether the user changed something or only viewed an existing report. Is
there a change in getting notified if the end-user made changes in design or
RAP?
Thanks for your help
Christian M. Meyer
Hescom-Software, Germany
I'd like to ask the End-User for saving a report's design. The dialog is
situated in the report's close events. My problem is, that I don't know
whether the user changed something or only viewed an existing report. Is
there a change in getting notified if the end-user made changes in design or
RAP?
Thanks for your help
Christian M. Meyer
Hescom-Software, Germany
This discussion has been closed.
Comments
Designer.Report.modified lets you know if the report has been changed
in the designer -- I don't use rap, so I don't know if it gets set in
that case, but you can test it. I include the OnClose event handler we
use here, below.
-Janine Anderson
Black Bear Systems, Inc.
-----------------
procedure TForm1.DesignerClose(Sender: TObject; var Action:
TCloseAction);
var
mr: TModalResult;
begin
if Designer.Report.Modified then begin
mr:= MessageDlg('Save Report before
Closing?',mtConfirmation,[mbYes,mbNo,mbCancel],0);
if mr = idCancel then
Action:= caNone
else if mr = idNo then
Action:= caFree
else begin
SaveDialog.Filename:= Designer.Report.Template.Filename;
if SaveDialog.Execute then begin
Designer.Report.Template.Filename:= SaveDialog.Filename;
Designer.Report.Template.SavetoFile;
Action:= caFree;
end
else
Action:= caNone;
end;
end
else
Action:= caFree;
end;