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

reportname

edited August 2005 in General
Hi,

I really like to change the standard text: 'new report', in the save dialog.
It should be the name which the user has been entered in a label on the
report.
Is this possible? If so:
- Can u tell me please where in the code this should be done (event,
procedure)?
- How can the label.caption be accessed (tried findcomponent but the
result was nil)?

Tks in advance,

Jozua

Comments

  • edited August 2005
    H Jozua,

    Try setting the Report.Template.DataBaseSettings.Name property to the file
    name you want inside the TppDesigner.Show event. This will change the
    default name a new report is saved however you will then need to click on
    the "Save As" option to see the dialog because ReportBuilder uses the name
    "New Report" to determine if it is actually a new report being saved..

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2005
    Hi Nico,



    Tks for your quick reply, but this is not really what I wanted :D.

    When I change Report.Template.DataBaseSettings.Name property in the Show
    event

    the name of the report is already set before the user see the report. I want
    the user to determine the name of the report by changing the caption of a
    Tpplabel. So the onshow event is to early. Beside that, when I change the
    DataBaseSettings.Name property, 'New Report' is still shown in the save as
    dialog.



    Tks in advance,



    Jozua





  • edited August 2005
    Hi Jozua,

    Ok, sorry after further research it seems that the final place this value is
    set to "New Report" is in the TppReportExplorer.ReportCreateDialogEvent.
    There is currently not good event to use when a label (or any other
    component) is changed in the designer so I used the
    TppTemplate.OnCreateDialog event and changed the
    ReportExplorer.CurrentItemName property. Not sure this will work for your
    specific case but I believe it is the best ReportBuilder can offer at this
    point. Hope this helps.

    procedure TmyEndUserSolution.CreateDialogEvent(Sender, aDialog: TObject);
    begin
    ppReportExplorer1.CurrentItemName := 'myFile';
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2005
    woo tks ;)
    this is what we needed, works great !

This discussion has been closed.