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

Did user modify report?

edited February 2002 in General
After a call to TppDesigner.ShowModal, is there a way to determine if the
user has (or has not) made any changes at all to the report design?

--

Mvh/regards
Svein Olav Mytting
Intelligent Software AS
Bogstadvn 60A, 0366 Oslo
www.IntelligentSoftware.no

Comments

  • edited February 2002
    Hi Svein,

    check the property 'Report.Modified' in the designer's 'OnClose' event.



    procedure TStandardMethodObject.DesignerClose(Sender: TObject;
    var Action: TCloseAction);
    begin
    Action := caFree;

    if Sender = nil then begin
    Exit;
    end;

    if not (Sender is TppDesignerWindow) then begin
    Exit;
    end;

    if TppDesignerWindow(Sender).CurrentReport = nil then begin
    Exit;
    end;

    with (TppDesignerWindow(Sender).CurrentReport) do begin
    if Modified then begin
    Template.SaveToFile;
    end;
    end;

    end;



    regards,
    Chris Ueberall;

  • edited February 2002
    It seems that Report.Modified is always true in the DesignerClose event -
    even if the user did not change anything.
    I even tried to set Report.Modified := false before launching the Designer,
    and to save the report directly before launching the Designer....to no
    avail.


  • edited February 2002
    Svein,

    Unfortunately, it seems that you are right.
    I think the reason is that the report doesn't use the default 'Units'
    setting 'utInches'.
    Looks like a bug in TppDesignerWindow.SyncUnits, not respecting the loading
    state of the template.
    I am sure, you will see here a comment from DM in short.

    regards,
    Chris Ueberall;

  • edited February 2002
    Thanks, this has been fixed for the next maintenance release.

    Svein, please send a request which includes your correct email address to
    support@digital-metaphors.com and we'll send you a patched unit.

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.