📄 u_p_fhp.pas
字号:
unit U_P_FHP;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs,
Qrctrls, QuickRpt, ExtCtrls, StdCtrls, Mask, DBCtrls, Db, ADODB;
type
TF_P_FHP = class(TForm)
QuickRep1: TQuickRep;
QRBand2: TQRBand;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRBand1: TQRBand;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel1: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel11: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel19: TQRLabel;
QRLabel23: TQRLabel;
QRLabel22: TQRLabel;
QRLabel21: TQRLabel;
QRLabel20: TQRLabel;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape9: TQRShape;
QRLabel24: TQRLabel;
QRLabel25: TQRLabel;
QRLabel28: TQRLabel;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
QRLabel31: TQRLabel;
QRLabel32: TQRLabel;
QRLabel33: TQRLabel;
QRLabel34: TQRLabel;
QRLabel35: TQRLabel;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
QRDBImage1: TQRDBImage;
ADOQueryFHPBB: TADOQuery;
PageFooterBand1: TQRBand;
QRLabel40: TQRLabel;
QRLabel41: TQRLabel;
QRLabel42: TQRLabel;
QRLabel43: TQRLabel;
QRLabel36: TQRLabel;
QRLabel38: TQRLabel;
QRLabel37: TQRLabel;
QRLabel39: TQRLabel;
QRDBText13: TQRDBText;
QRDBText14: TQRDBText;
QRDBText15: TQRDBText;
QRDBRichText1: TQRDBRichText;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape3: TQRShape;
procedure FormCreate(Sender: TObject);
procedure QuickRep1AfterPreview(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_P_FHP: TF_P_FHP;
iFHP: Integer;
implementation
uses U_DM, U_FPCX, U_FHP;
{$R *.DFM}
procedure TF_P_FHP.FormCreate(Sender: TObject);
begin
iFHP:=0;
if FHPCXshow=true then
begin
QuickRep1.DataSet:=ADOQueryFHPBB;
ADOQueryFHPBB.Close;
ADOQueryFHPBB.SQL.Clear;
ADOQueryFHPBB.SQL.Add('select * from xs_FHP where DingdanNo='''+F_FPCX.DBEditDingDanNo.Text+'''');
ADOQueryFHPBB.Open;
{QRDBText1.Lines.Text:=ADOQueryFHPBB.fieldbyname('ReceivingUnit').asstring;
QRDBText2.Lines.Text:=ADOQueryFHPBB.fieldbyname('ContractNo').asstring;
QRDBText5.Lines.Text:=ADOQueryFHPBB.fieldbyname('Date').asstring;
QRDBText6.Lines.Text:=ADOQueryFHPBB.fieldbyname('TelNo').asstring;
QRDBText7.Lines.Text:=ADOQueryFHPBB.fieldbyname('PayingUnit').asstring;
QRDBText8.Lines.Text:=ADOQueryFHPBB.fieldbyname('LCNo').asstring;
QRDBText9.Lines.Text:=ADOQueryFHPBB.fieldbyname('IssuedBy').asstring;
// QRDBRichText1.DataField:=ADOQueryFHPBB.fieldbyname('xianghao').asstring;
//QRDBImage1.Picture:=ADOQueryFHPBB.fieldbyname('picture1').aspicture;
QRDBText13.Lines.Text:=ADOQueryFHPBB.fieldbyname('RAddress').asstring;
QRDBText14.Lines.Text:=ADOQueryFHPBB.fieldbyname('PAddress').asstring;
QRDBText15.Lines.Text:=ADOQueryFHPBB.fieldbyname('MarkNos').asstring; }
end;
///
if FHPshow=true then
begin
QuickRep1.DataSet:=DM.ADOQueryFPCX;
QRDBText1.DataSet:=DM.ADOQueryFPCX;
QRDBText2.DataSet:=DM.ADOQueryFPCX;
QRDBText5.DataSet:=DM.ADOQueryFPCX;
QRDBText6.DataSet:=DM.ADOQueryFPCX;
QRDBText7.DataSet:=DM.ADOQueryFPCX;
QRDBText8.DataSet:=DM.ADOQueryFPCX;
QRDBText9.DataSet:=DM.ADOQueryFPCX;
QRDBText13.DataSet:=DM.ADOQueryFPCX;
QRDBText14.DataSet:=DM.ADOQueryFPCX;
QRDBText15.DataSet:=DM.ADOQueryFPCX;
QRDBImage1.DataSet:=DM.ADOQueryFPCX;
QRDBRichText1.DataSet:=DM.ADOQueryFPCX;
DM.ADOQueryFPCX.Close;
DM.ADOQueryFPCX.SQL.Clear;
DM.ADOQueryFPCX.SQL.Add('select * from xs_FHP where DingdanNo='''+F_FHP.DBEditDingDanNo.Text+'''');
DM.ADOQueryFPCX.Open;
{ QRDBText1.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('ReceivingUnit').asstring;
QRDBText2.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('ContractNo').asstring;
QRDBText5.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('Date').asstring;
QRDBText6.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('TelNo').asstring;
QRDBText7.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('PayingUnit').asstring;
QRDBText8.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('LCNo').asstring;
QRDBText9.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('IssuedBy').asstring;
// QRDBRichText1.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('xianghao').asstring;
//QRDBImage1.Picture:=DM.ADOQueryFPCX.fieldbyname('picture1').asstring;
QRDBText13.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('RAddress').asstring;
QRDBText14.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('PAddress').asstring;
QRDBText15.Lines.Text:=DM.ADOQueryFPCX.fieldbyname('MarkNos').asstring; }
end;
end;
procedure TF_P_FHP.QuickRep1AfterPreview(Sender: TObject);
begin
F_P_FHP.Close;
end;
procedure TF_P_FHP.FormClose(Sender: TObject; var Action: TCloseAction);
begin
F_P_FHP:=nil;
Action:=caFree;
end;
procedure TF_P_FHP.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
iFHP:=iFHP+1;
if Odd(iFHP) then //iFHP为打印之前使QRLabel和Shape不可见,因为BeforePrint事件
Exit //在预览时就发生一次,所以设置iFHP标志把BeforePrint事件发生的奇数次去掉
else begin
QRLabel1.Caption:='';
QRLabel2.Caption:='';
QRLabel3.Caption:='';
QRLabel4.Caption:='';
QRLabel5.Caption:='';
QRLabel6.Caption:='';
QRLabel7.Caption:='';
QRLabel8.Caption:='';
QRLabel9.Caption:='';
QRLabel10.Caption:='';
QRLabel11.Caption:='';
QRLabel12.Caption:='';
QRLabel13.Caption:='';
QRLabel14.Caption:='';
QRLabel15.Caption:='';
QRLabel16.Caption:='';
QRLabel17.Caption:='';
QRLabel18.Caption:='';
QRLabel19.Caption:='';
QRLabel20.Caption:='';
QRLabel21.Caption:='';
QRLabel22.Caption:='';
QRLabel23.Caption:='';
QRLabel24.Caption:='';
QRLabel25.Caption:='';
QRLabel26.Caption:='';
QRLabel27.Caption:='';
QRLabel28.Caption:='';
QRLabel29.Caption:='';
QRLabel30.Caption:='';
QRLabel31.Caption:='';
QRLabel32.Caption:='';
QRLabel33.Caption:='';
QRLabel34.Caption:='';
QRLabel35.Caption:='';
QRLabel36.Caption:='';
QRLabel37.Caption:='';
QRLabel38.Caption:='';
QRLabel39.Caption:='';
QRShape1.Enabled:=False;
QRShape2.Enabled:=False;
QRShape3.Enabled:=False;
QRShape4.Enabled:=False;
QRShape5.Enabled:=False;
QRShape6.Enabled:=False;
QRShape7.Enabled:=False;
QRShape8.Enabled:=False;
QRShape9.Enabled:=False;
QRShape10.Enabled:=false;
QRShape11.Enabled:=false;
end;
end;
procedure TF_P_FHP.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if FHPshow=true then
DM.ADOQueryFPCX.Close;
if FHPCXshow=true then
ADOQueryFHPBB.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -