📄 uprint.pas
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -