Access report objects from a code
FastReport’ s objects (such as report page, band, memo-object) are not directly accessible from your code. This means that you cannot address the object by its name, as, for example, when you addressing to a button on your form. To address an object, it should be found with the help of the TfrxReport.FindObject
method:
Pascal:
var
Memo1: TfrxMemoView;
Memo1 := frxReport1.FindObject('Memo1') as TfrxMemoView;
C++:
TfrxMemoView * Memo = dynamic_cast <TfrxMemoView *> (frxReport1->FindObject("Memo1"));
after that, one can address the object’s properties and methods. You can address the report’s pages using the TfrxReport.Pages
property:
Pascal:
var
Page1: TfrxReportPage;
Page1 := frxReport1.Pages[1] as TfrxReportPage;
C++:
TfrxReportPage * Page1 = dynamic_cast <TfrxReportPage *> (frxReport1->Pages[1]);