How to use OnGetReport ?

Hello, I need an example of OnGetReport event.

I started with a simple test, like:
procedure TMainForm.ServGetReport(const ReportName: String;
Report: TfrxReport);
begin
Report.LoadFromFile(ReportName)
end;

and I got an error...don't know how to use it (I'd wish to change the SQL query depending on the ReportName, and open the report soon after...but I can't even open the report).

Has anybody succeeded using it ?
TIA

Comments

  • edited 11:52AM
    I've found the reason:
    ReportName has no path.

    Unfortunately, we have reports in different folders, and I don't know how to choose the right one because the folder is stripped.

    The session object has a filename property, but I can't reach the session object easily in the OnGetReport event.

    I would be glad if TfrxreportSession could pass itself to the callback like

    procedure TfrxReportSession.DoOnGetReport;
    begin
    TfrxReportServer(FParentReportServer).OnGetReport(self,FName, FReport);
    end;

    so that I could something like

    procedure TMainForm.ServGetReport(sender:TfrxReportSession;const ReportName: String;
    Report: TfrxReport);
    begin
    Report.LoadFromFile(sender.FileName)
    end;

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.