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
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
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;