主题:fastreport分页
我想把listview中的内容读出来,写在fastreport的memo中,listview中读完一行就分页但是不知道怎么分页.我的代码如下,请告诉我分页代码要写在那里?
procedure TForm_print.Button_printClick(Sender: TObject);
var
i:integer;
Memo_xm,Memo_nf,Memo_jd,Memo_km,Memo_dj,Memo_bh,Memo_km1:TfrMemoView;
Page:TfrPage;
km,mykm:string;
begin
frReport1.Clear;
frReport1.LoadFromFile(extractfilepath(application.ExeName)+'Untitled.frf');
for i:=0 to ListView.Items.Count -1 do
begin
//frxReport1.PrepareReport;
Memo_xm:=TfrMemoView(frReport1.FindObject('Memo2'));
Memo_nf:=TfrMemoView(frReport1.FindObject('Memo3'));
//Memo_nf:=TfrxMemoView(frReport1.FindObject('Memo3'));
Memo_jd:=TfrMemoView(frReport1.FindObject('Memo4'));
Memo_km:=TfrMemoView(frReport1.FindObject('Memo5'));
Memo_dj:=TfrMemoView(frReport1.FindObject('Memo6'));
Memo_bh:=TfrMemoView(frReport1.FindObject('Memo7'));
Memo_km1:=TfrMemoView(frReport1.FindObject('Memo12'));
if Memo_xm<>nil then
Memo_xm.Memo.Text:=listview.Items[i].SubItems.Strings[0];
if Memo_km<>nil then
//Memo_km.Memo.Text:=listview.Items[i].SubItems.Strings[3];
begin
km:= listview.Items[i].SubItems.Strings[3];
Memo_km.Memo.Text:= copy(km,5,length(km)-1);
end;
if Memo_dj<>nil then
Memo_dj.Memo.Text:=listview.Items[i].SubItems.Strings[2];
if Memo_bh<>nil then
Memo_bh.Memo.Text:=listview.Items[i].Caption;
if Memo_km1<>nil then
Memo_km1.Memo.Text:= copy(listview.Items[i].SubItems.Strings[3],1,4);
end;
if frReport1.PrepareReport then
frReport1.ShowPreparedReport;
end;
procedure TForm_print.Button_printClick(Sender: TObject);
var
i:integer;
Memo_xm,Memo_nf,Memo_jd,Memo_km,Memo_dj,Memo_bh,Memo_km1:TfrMemoView;
Page:TfrPage;
km,mykm:string;
begin
frReport1.Clear;
frReport1.LoadFromFile(extractfilepath(application.ExeName)+'Untitled.frf');
for i:=0 to ListView.Items.Count -1 do
begin
//frxReport1.PrepareReport;
Memo_xm:=TfrMemoView(frReport1.FindObject('Memo2'));
Memo_nf:=TfrMemoView(frReport1.FindObject('Memo3'));
//Memo_nf:=TfrxMemoView(frReport1.FindObject('Memo3'));
Memo_jd:=TfrMemoView(frReport1.FindObject('Memo4'));
Memo_km:=TfrMemoView(frReport1.FindObject('Memo5'));
Memo_dj:=TfrMemoView(frReport1.FindObject('Memo6'));
Memo_bh:=TfrMemoView(frReport1.FindObject('Memo7'));
Memo_km1:=TfrMemoView(frReport1.FindObject('Memo12'));
if Memo_xm<>nil then
Memo_xm.Memo.Text:=listview.Items[i].SubItems.Strings[0];
if Memo_km<>nil then
//Memo_km.Memo.Text:=listview.Items[i].SubItems.Strings[3];
begin
km:= listview.Items[i].SubItems.Strings[3];
Memo_km.Memo.Text:= copy(km,5,length(km)-1);
end;
if Memo_dj<>nil then
Memo_dj.Memo.Text:=listview.Items[i].SubItems.Strings[2];
if Memo_bh<>nil then
Memo_bh.Memo.Text:=listview.Items[i].Caption;
if Memo_km1<>nil then
Memo_km1.Memo.Text:= copy(listview.Items[i].SubItems.Strings[3],1,4);
end;
if frReport1.PrepareReport then
frReport1.ShowPreparedReport;
end;