Display the File name of the report?

edited 4:55PM in FastReport 3.0
Is it possible to access the filename of a report? Something like [self."filename"] and have it return "myReport.fr3".

Comments

  • edited 4:55PM
    Hello Doug,

    I don't know whether that is the easiest way, but you could define a category and then a variable in the Report, e.g. Category "FromDelphi", Variable "RepName". From Delphi you then use the code:
    frxRepRechnung.LoadFromFile('Rechnung.fr3');
       frxRepRechnung.Variables['RepName'] := ''''+frxRepRechnung.FileName+'''';
       frxRepRechnung.ShowReport;
    

    In the report you can use the report variable and show it wherever you want. ;)
  • edited 4:55PM
    Yes that may work.

    IMHO:
    Would also need to test the report to make sure the variable is there. This does not seem like best practice. I don't think Delphi should have to know or deal with variables in a report. Not the best encapsulation.

    The filename of the report should be a property of the report.

    How can I suggest that they add this property to the product?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.