uprint.pas

来自「相关的销售服务管理行业的一个软件」· PAS 代码 · 共 95 行

PAS
95
字号
unit Uprint;

interface

uses QRCTRLS,ADODB,Fprint,QUICKRPT,Sysutils,Forms;

Type TMatou = Record
       MyImage : TQrImage;
       MyMemo : TQRMemo;
  end;

procedure MyPrint(myQuery:TADOQuery;Pic:Integer;FieldName,theTitle:String);
var
  RepCount:Integer;
  myQR:Array of TfrmPrint;
  myRecord:Array of TMatou;
implementation

uses UTitle,UPrintTmp;

procedure MyPrint(myQuery:TADOQuery;Pic:Integer;FieldName,theTitle:String);
var
  myCount,i,tempCount,j,CountJilu:Integer;
  PicPath:String;
begin
  CountJilu:=0;
  PicPath:=ExtractFileDir(Application.Exename)+'\PrintF\'+IntToStr(Pic)+'.bmp';
  myCount:=myQuery.RecordCount;
  RepCount:=(myCount div 4);
  if (myCount mod 4)<>0 then RepCount:=RepCount+1;

  SetLength(myQR,RepCount);
  SetLength(myRecord,myCount);

  myQuery.First;

  for j:=0 to RepCount-1 do
    begin
      Application.CreateForm(TfrmPrint,myQR[j]);
      myQR[j].DetailBand1.SendToBack;

      if myCount>4 then Tempcount:=4
        else TempCount:=myCount;

      for i:=0 to TempCount-1 do
      begin
        myRecord[i+CountJilu].MyImage:=TQRImage.Create(myQR[j].DetailBand1);
        with myRecord[i+CountJilu].MyImage do
        begin
          Parent:=myQR[j].DetailBand1;
          Stretch:=True;
          Height:=80;
          Width:=135;
          Picture.LoadFromFile(PicPath);
          Top:=10+(i div 4)*200;
          Left:=10 +(i Mod 4)*185;
          BringToFront;
        end;

        myRecord[i+CountJilu].MyMemo:=TQRMemo.Create(myQR[j].DetailBand1);
        With myRecord[i+CountJilu].MyMemo do
        begin
          Parent:=myQR[j].DetailBand1;
          AutoSize:=false;
          Font.Name:='宋体';
          Font.Size:=9;
          Height:=130;
          Width:=90;
          Top:=myRecord[i].MyImage.Top+55;
          Left:=myRecord[i].MyImage.Left+25;
          transParent:=True;
          Lines.Append(myQuery.FieldByName(FieldName).Asstring);
          myQuery.Next;
          BringToFront;
        end;
      end;

      CountJilu:=CountJilu+TempCount;
    {  for i:= 0 to TempCount-1 do
      begin
        myRecord[i].MyImage.Free;
        myRecord[i].MyMemo.Free;
      end;    }
      myCount:=myCount-4;
  end;

 // myQR[0].Showmodal;
  Application.CreateForm(TfrmTitle,frmTitle);
  frmTitle.QRLabel1.Caption:=TheTitle;
  Application.CreateForm(TfrmPrintTmp,frmPrintTmp);
  screen.Cursor:=0;
  frmPrintTmp.CR.Preview;
end;
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?