zoukankan      html  css  js  c++  java
  • 不用SQL给打印记录编号

    以QUICKREPORT为例

    页面设置如下:

    其中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;

  • 相关阅读:
    Binary Tree Maximum Path Sum
    ZigZag Conversion
    Longest Common Prefix
    Reverse Linked List II
    Populating Next Right Pointers in Each Node
    Populating Next Right Pointers in Each Node II
    Rotate List
    Path Sum II
    [Leetcode]-- Gray Code
    Subsets II
  • 原文地址:https://www.cnblogs.com/happyhills/p/4139070.html
Copyright © 2011-2022 走看看