event handler in delphi
Hi, I'm trying to do the following but the event handler TForm1.OnBeforePrint is never called. What am i doing wrong ?
procedure TForm1.InitReport;
var
 Page : TfrxReportPage;
 Cross : TfrxCrossView;
begin
 // Create a new function
 frxReport1.AddFunction('procedure Cross1OnBeforePrint(Sender: TfrxComponent)', 'DelphiHandler');
 // Add the TfrxCrossView to it
 Page := TfrxReportPage(frxReport1.FindObject('Page1'));
 Cross := TfrxCrossView.Create(Page);
 Cross.Name := 'Cross1';
 Cross.SetBounds(0,0,20,15);
 Cross.RowLevels := 1;
 Cross.ColumnLevels := 1;
 Cross.OnBeforePrint := 'Cross1OnBeforePrint';
 Cross.OnAfterData := TfrxNotifyEvent
 FCross := Cross;
// Â frxReport1.PrepareReport(true);
 frxReport1.DesignReport;
// Â frxReport1.ShowReport;
end;
procedure TForm1.OnBeforePrint;
var
 Page : TfrxReportPage;
begin
 ShowMessage('Hello from delphi');
 FCross.AddValue(['Binnen 1 week'], ['Q1 2005'], [0.6]);
{
 Page := frxReport1.FindObject('Page1') as TfrxReportPage;
 Cross := Page.FindObject('Cross1');
}
end;
function TForm1.frxReport1UserFunction(const MethodName: String;
 var Params: Variant): Variant;
begin
 if MethodName = UpperCase('Cross1OnBeforePrint') then
  OnBeforePrint;
end;
Comments
I don't know well delphi to undestand the problem, and for this reason i need help.
Be patient for my very stupid question:
Why this row i not closed with ;
Cross.OnAfterData := TfrxNotifyEvent
What is FCross and where is declared?
FCross := Cross;
The event procedure TForm1.frxReport1BeforePrint give me compile error.
Thank you.