我正在尝试将AdvOfficeStatusBar1.Panels [0]的内容传递给frxreport1的Memo 4。 AdvOfficeStatusBar1.Panels [0]是日期类型(psDate)。所以在我打开报告之前,我希望备忘录显示我的状态栏日期。
答案 0 :(得分:1)
我自己发现了这个:
procedure TForm1.cxButton1Click(Sender: TObject);
var
Memo: TfrxMemoView;
Component: TfrxComponent;
begin
Component := frxReport1.FindObject('Memo4');
if Component is TfrxMemoView then
begin
Memo := Component as TfrxMemoView;
Memo.Text := AdvOfficeStatusBar1.Panels[0].Text;
frxReport1.ShowReport;
end;
end;
答案 1 :(得分:0)
您可以使用以下代码设置fastreport备忘录的文本:
procedure SetMemo(aReport: TfrxReport; aMemoName: string; aText: string);
var
memo: TfrxMemoView;
begin
memo := aReport.FindObject(aMemoName) as TfrxMemoView;
if memo <> nil then
memo.Text := aText;
end;