Memo, Create new memo and setting from code
Using Fast Reports and Delphi 7. (I created all these problems from delphi 7 how do I apply at fast report)
trouble 1 :but how to create new object memo ? I tried this code below but not working
var
Page : TfrxReportPage;
Memo: TfrxMemoView;
begin
Page := TfrxReportPage(report.Pages[1]);
Page.Orientation := poLandscape;
Memo := TfrxMemoView(Page);
Memo.Create(nil);
Memo.Text := 'test';
where the error of my code ?
trouble 2 : how to make the settings manually from Delphi to memo (tfrxmemoview) / label the fast report
1.Top
2.Left
3.Line spacing
4.Width
5.Height
I expect a good example of how,thanks for the help of his suggestions
trouble 1 :but how to create new object memo ? I tried this code below but not working
var
Page : TfrxReportPage;
Memo: TfrxMemoView;
begin
Page := TfrxReportPage(report.Pages[1]);
Page.Orientation := poLandscape;
Memo := TfrxMemoView(Page);
Memo.Create(nil);
Memo.Text := 'test';
where the error of my code ?
trouble 2 : how to make the settings manually from Delphi to memo (tfrxmemoview) / label the fast report
1.Top
2.Left
3.Line spacing
4.Width
5.Height
I expect a good example of how,thanks for the help of his suggestions
Comments
code 1:
procedure TForm1.SettingMemoClick(Sender: TObject);
var Memo: TfrxMemoView;
begin
Memo.CreateUniqueName;
Memo.Text := 'Hello FastReport!';
Memo.Height := 20;
Memo.Align := baWidth;
Memo.SetBounds(StrToInt(EditTopMargin.text), 0, 100, 20);
frxReport1.ShowReport;
end;
or code 2:
procedure TForm1.SettingMemoClick(Sender: TObject);
var Memo: TfrxMemoView;
begin
Memo:= StrToInt(EditCOL_PAGE.text);//for Column page
Memo:= StrToInt(EditRow_PAGE.text);//for maximum limit of rows
Memo:= StrToInt(EditTopMemo.text);//for Top Memo
Memo:= StrToInt(EditLeftMemo.text);//for Left Memo
Memo:= StrToInt(EditWIDTH.text);//for width memo
Memo:= StrToInt(EditHEIGHT.text);//for height memo
Memo:= StrToInt(EditLine_Spacing.text);//for line spacing memo
frxReport1.ShowReport;
end;
or if you are trying to add to an existing report you must have loaded the report into a tfrxreport component and then use findobject to get the object to which the new memoview will be added.
TfrxMemoView(frxReport1.FindObject('Memo1')).Left := 100;
TfrxMemoView (frxReport1.FindObject ('Memo1')). LineSpacing: = 100;