以QUICKREPORT为例

页面设置如下:

不用SQL给打印记录编号

其中ID为编号。

设置为表的ID字段。

 

QUICKREPORT所在的FORM添加一个变量:

var
FprnT6: TFprnT6;
Vxh:integer; //编号变量

 

公开一个方法,用以设置变量的初始值:

public
{ Public declarations }
procedure Setxh(Axh:integer);

 

procedure TFprnT6.Setxh(Axh:integer);
begin
Vxh:=Axh;
end;

 

在ID的ONPRINT方法添加如下代码:
procedure TFprnT6.QRPDBText1Print(sender: TObject; var Value: string);
begin
Vxh:=Vxh+1;
Value:=inttostr(Vxh);
end;

 

 

控制打印主程序如下:


procedure TFCountMain.DoCountT6(Gtitle,GTdate:string);
var
sqlstr:string;
begin

Application.CreateForm(TFprnT6, FprnT6);
FprnT6.QRLtitle.Caption:=Gtitle;
FprnT6.QRLreportdate.Caption:=GTdate;
FprnT6.Setxh(0); //序号清零
sqlstr:='select * from Tperson ';
dm.LoadPersonBySql(sqlstr);//提取数据记录
FprnT6.QuickRep1.Print;

end;

 

相关文章:

  • 2021-09-24
  • 2021-11-16
  • 2021-10-22
  • 2022-01-07
  • 2022-12-23
  • 2021-06-25
  • 2021-09-16
  • 2022-02-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2022-01-26
  • 2021-09-09
  • 2022-12-23
相关资源
相似解决方案