如何在运行时在Lazarus中从数据库传递Lazreport变量中的参数?

问题描述

如果我想在“ frReport1GetValue”事件中通过zeosDBO将来自Ms Access数据库的参数传递给Lazreport。 我的数据库记录是: enter image description here

procedure TForm2.frReport1GetValue(const ParName: String; var ParValue: Variant); 

 ZQuery1.ReadOnly :=true;

 ZQuery1.sql.Text := 'select * from Test';

 ZQuery1.Open;

 x := 0;

while not ZQuery1.EOF  do

begin

  if ParName = 'MyTxt' then

  begin

    ParValue := ZQuery1.FieldByName('UName').Text;

  end;

ZQuery1.Next;

x :=x+1;

end;

这将仅显示Lazreport中的最后一条记录重复

enter image description here

我们如何在Lazreport中以正确的方式获取报告。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)