Correct way to make report interactive?
I've duplicated the code from the user manual but the ClickObject method in my program is not being called. (a breakpoint set on the first line is not even being hit).
I can get the FR4 demo code to work OK and can happily make alterations to it that work. I'm sure my code looks the same as the demo code so I must be missing something.
I'd really appreciate it if someboby can see what is wrong with this code below?
This is my type declaration
and this is my method declaration
(Added later) Looking closely I find that the example shown in the programmers manual - and in my code above, is actually slightly different from that in the demo program. In the demo program there is no 'page' parameter. The declaration instead is just
procedure MainReportClickObject(View: TfrxView; Button: TMouseButton; Shift: TShiftState; var Modified: Boolean);
Is this a mistake in the manual? It it only the one without the page parameter that works? In not what is the difference?
I can get the FR4 demo code to work OK and can happily make alterations to it that work. I'm sure my code looks the same as the demo code so I must be missing something.
I'd really appreciate it if someboby can see what is wrong with this code below?
This is my type declaration
type
TForm2 = class(TForm)
frxDBDataset_LeagueTable: TfrxDBDataset;
frxReportLeagueTable: TfrxReport;
DataSource1: TDataSource;
ADOQrySourceForLeagueTable: TADOQuery;
procedure ShowLeagueTable;
//This method handles mouse clicks in the report
procedure frxReportLeagueTableClickObject(Page: TfrxPage; View: TfrxView; Button: TMouseButton; Shift: TShiftState; var Modified: Boolean);
private
{ Private declarations }
public
end;
and this is my method declaration
procedure TForm2.frxReportLeagueTableClickObject(Page: TfrxPage; View: TfrxView; Button: TMouseButton; Shift: TShiftState; var Modified: Boolean);
var sql:string;
begin
if view.name = 'Memo23' then //<---------- never reaches here no matter where I click in the report
begin
sql := SQL_LeagueTableBySurname;
ADOQrySourceForLeagueTable.Close; //put sql into query for report source
ADOQrySourceForLeagueTable.sql.Clear ;
ADOQrySourceForLeagueTable.SQL.Add(sql);
frxReportLeagueTable.ShowReport(true);//show the report
end;
(Added later) Looking closely I find that the example shown in the programmers manual - and in my code above, is actually slightly different from that in the demo program. In the demo program there is no 'page' parameter. The declaration instead is just
procedure MainReportClickObject(View: TfrxView; Button: TMouseButton; Shift: TShiftState; var Modified: Boolean);
Is this a mistake in the manual? It it only the one without the page parameter that works? In not what is the difference?