D
dafuwengqing
Unregistered / Unconfirmed
GUEST, unregistred user!
我用fastreport2.5是到调用frReport1.Preview:=Form_printformat.frPreview1;出现内存错误?
代码如下,请指教:
var
i:integer;
Memo_xm,Memo_nf,Memo_jd,Memo_km,Memo_dj,Memo_bh,Memo_km1:TfrMemoView;
Page:TfrxReportPage;
km,mykm:string;
begin
frReport1.Clear;
frReport1.LoadFromFile(extractfilepath(application.ExeName)+'Untitled.frf');
for i:=0 to ListView.Items.Count -1do
begin
Memo_xm:=TfrMemoView(frReport1.FindObject('Memo2'));
Memo_nf:=TfrMemoView(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.SubItems.Strings[0];
if Memo_km<>nil then
Memo_km.Memo.Text:=listview.Items.SubItems.Strings[3];
begin
km:= listview.Items.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.SubItems.Strings[2];
if Memo_bh<>nil then
Memo_bh.Memo.Text:=listview.Items.Caption;
if Memo_km1<>nil then
Memo_km1.Memo.Text:= copy(listview.Items.SubItems.Strings[3],1,4);
end;
frReport1.Preview:=Form_printformat.frPreview1;
代码如下,请指教:
var
i:integer;
Memo_xm,Memo_nf,Memo_jd,Memo_km,Memo_dj,Memo_bh,Memo_km1:TfrMemoView;
Page:TfrxReportPage;
km,mykm:string;
begin
frReport1.Clear;
frReport1.LoadFromFile(extractfilepath(application.ExeName)+'Untitled.frf');
for i:=0 to ListView.Items.Count -1do
begin
Memo_xm:=TfrMemoView(frReport1.FindObject('Memo2'));
Memo_nf:=TfrMemoView(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.SubItems.Strings[0];
if Memo_km<>nil then
Memo_km.Memo.Text:=listview.Items.SubItems.Strings[3];
begin
km:= listview.Items.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.SubItems.Strings[2];
if Memo_bh<>nil then
Memo_bh.Memo.Text:=listview.Items.Caption;
if Memo_km1<>nil then
Memo_km1.Memo.Text:= copy(listview.Items.SubItems.Strings[3],1,4);
end;
frReport1.Preview:=Form_printformat.frPreview1;