ReportMachine怎样传入用户自定义的数据,而不用数据库(100)

  • 主题发起人 主题发起人 liuchong
  • 开始时间 开始时间
L

liuchong

Unregistered / Unconfirmed
GUEST, unregistred user!
向RM中传入数据,代码如下:procedure TForm1.RMReport1GetValue(const aParName: String; var aParValue: Variant);var I:Integer;begin for I:=0 to 100 do begin if aParName='x' then aParValue:=I; end;end;可是RM中只传入了一个100,原意是想从0到100全部传入,帮忙解决一下,谢谢
 
type TForm1 = class(TForm) rmrprt1: TRMReport; rmsrdtst1: TRMUserDataset; btn1: TButton; rmsbrcdbjct1: TRMAsBarCodeObject; procedure btn1Click(Sender: TObject); procedure rmrprt1GetValue(const aParName: String; var aParValue: Variant); procedure rmsrdtst1CheckEOF(Sender: TObject; var aEOF: Boolean); procedure rmsrdtst1Next(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1; I:Integer=10;implementation{$R *.dfm}procedure TForm1.btn1Click(Sender: TObject);begin rmrprt1.ShowReport;end;procedure TForm1.rmrprt1GetValue(const aParName: String; var aParValue: Variant);begin if aParName='x' then aParValue:=I;end;procedure TForm1.rmsrdtst1CheckEOF(Sender: TObject; var aEOF: Boolean);begin aEOF:=I=20;end;procedure TForm1.rmsrdtst1Next(Sender: TObject);begin Inc(I);end;
 
这是我用的办法。给你参考一下。你看看是不是有用。 rmreport1.LoadFromFile(ExtractFileDir(Application.Exename) + '/xqd.rmf'); rmreport1.Dictionary.Variables['zl']:=edt1.text; rmreport1.Dictionary.Variables['zf']:=edt2.Text; rmreport1.Dictionary.Variables['rq']:=dtp1.Date; Rmreport1.Dictionary.Variables['gs']:=edit1.Text; Rmreport1.Dictionary.Variables['dh']:=edit2.Text; RMReport1.ShowReport;
 
后退
顶部