procedure TForm1.FlatButton1Click(Sender: TObject);
var
RMReport:TRMReport;
begin
// if ADOQuery1.IsEmpty then
// Exit;
ADOQuery1.Close;
ADOQuery1.SQL.Text :='select * from JLCL_T';
ADOQuery1.Open;
try
RMReport1 := TRMReport.Create(Self);
RMReport1.LoadFromFile('cld.rmf');
RMReport1.PrepareReport;
RMReport1.ShowReport;
finally
RMReport1.Free;
end;
end;
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EInvalidPointer with message 'Invalid pointer operation'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
运行中出这个错误,请大侠帮忙!
可以简单一点的,如果你的计算量不大的话。
var
Report: TrmReport;
t:TRmView;
PrintFile:string;
begin
PrintFile:=AppPath + '/' + PrintFilePath + '/' + self.Name + '.rmf';
if FileExists(PrintFile) then
begin
with frm_bbdo
begin
RmReport1.LoadFromFile(PrintFile);
Report:= rmReport1;
t:=Report.FindObject('memo_p');
if t<>nil then
t.Memo.Text:='打印人:'+UserName;
Report.ShowReport;
end;
end;
end;
在RM中要有一个Memo的Name为'memo_p'