Home End User

how to change report name for Exit save

edited December 2002 in End User
For TppDesigner, I load the template from database and I don't allow user to
simply save and load any report they want. This is because the reports are
shared in a client/server database and only users with enough priority can
access them. For report, I use an ID field for unique key, as in the report
code is not unique. According to the sample, you would need a unique name to
load a template from database (LoadfromDatabase). So, because of this, the
ID is used.

My problem is when I exit, it prompt the message. "Save changes to ##?'
where ## is the ID. How do I show the Report Code instead of the Report ID??

TIA

Comments

  • edited December 2002
    You aren't using the ReportExplorer? This would be the easiest way to manage
    the reports for you users.

    You can change the Report.Name by reading from a query on the templates
    table to get at the name field and set the Report.Name property. Use the
    Report.Template.OnLoadEnd event to set this, so that it will be already set
    on the report before the report is saved.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    nope. We're not using the Report Explorer. My supervisor wants something
    more and at least we could customize however we wants to. I'll try on your
    suggestion and see if it can work.
  • edited December 2002
    Urrm..It didn't work. I'm not sure what is wrong. could you check it out?

    FormCreate
    begin
    ppReport.Template.OnLoadEnd := TemplateOnLoadEnd;
    end;

    procedure TForm1.TemplateOnLoadEnd(Sender: TObject);
    begin
    ppReport.Template.Report.Name := 'hello';
    end;

  • edited December 2002
    You can create a report explorer form replacement if you want to change the
    visual interface to your bosses liking. There is an example of registering a
    replacement in the installed tutorials in:

    C:\Program Files\Borland\Delphi6\RBuilder\Tutorials\Complete\II.
    Applications\04. End-User with Custom Explorer

    I was mistaken. The property used in the confirmation dialog is
    Report.Template.Description, which gets its value from the
    Report.Template.DatabaseSettings.Name. You could try setting that property
    after loading the report template.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited January 2003
    OK, could we stay out from the report explorer first? I mean it wasn't my
    call to replace it anyway. :)

    back to the confirmation dialog, the code that you gave me did do the job
    but it introduced a bug. When I save, it show:

    "EIBClientError: Cannot insert into dataset. (No insert query)."

    I guess it is quite clear what happened. It couldn't locate the record. RB
    uses the Description to locate the record. Is there any workaround. It is
    kinda important..

This discussion has been closed.