📄 uform_report_jy.pas
字号:
unit Uform_report_jy;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ComCtrls, DB, ADODB, ImgList, ExtCtrls,
QRCtrls, QuickRpt;
type
Tform_report_jy = class(TForm)
Panel1: TPanel;
Image1: TImage;
Label2: TLabel;
Label1: TLabel;
Bevel1: TBevel;
Image2: TImage;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
ImageList1: TImageList;
recordset_temp: TADOQuery;
Panel2: TPanel;
ListView1: TListView;
Panel3: TPanel;
Panel4: TPanel;
BitBtn3: TBitBtn;
BitBtn2: TBitBtn;
recordset_temp2: TADOQuery;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
Panel5: TPanel;
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape9: TQRShape;
QRShape10: TQRShape;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel4: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel5: TQRLabel;
DetailBand1: TQRBand;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
PageFooterBand1: TQRBand;
SummaryBand1: TQRBand;
PageHeaderBand1: TQRBand;
QRLabel11: TQRLabel;
TitleBand1: TQRBand;
procedure FormShow(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure ListView1Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
form_report_jy: Tform_report_jy;
implementation
uses Uform_xf_limit, Uform_main;
{$R *.dfm}
procedure Tform_report_jy.FormShow(Sender: TObject);
begin
listview1.Clear ;
label4.Caption :='';
label5.Caption :='';
label7.Caption :='';
label10.Caption :='';
label12.Caption :='';
label14.Caption :='';
label15.Caption :='';
label17.Caption :='';
label19.Caption :='';
end;
procedure Tform_report_jy.BitBtn2Click(Sender: TObject);
var
i:integer;
ListItem: TListItem;
p:^integer;
sdate:tdate;
edate:tdate;
smoney:integer;
emoney:integer;
begin
//limit the fw 2002--1-30pm
form_xf_limit.ShowModal ;
//cancel the limit
if form_xf_limit.yesno=false then
begin
exit;
end;
form_main.Dconnect.Execute('delete * from [JP]');
//get the limit
listview1.Clear ;
recordset_temp2.SQL.Clear ;
recordset_temp2.SQL.Add('select * from [JP]');
recordset_temp2.Open ;
sdate:=form_xf_limit.sdate ;
edate:=form_xf_limit.edate ;
smoney:=form_xf_limit.smoney ;
emoney:=form_xf_limit.emoney ;
recordset_temp.SQL.Clear;
recordset_temp.SQL.Add('select [JY_ID],[FW_NAME],[FW_DOLLOR],[JY_FWCOUNT],[JY_ALLDOLLOR],[JY_DATE],[CUSTOM_CODE] from [JY],[FW],[CUSTOM] where [CUSTOM_ID]=[JY_CUSTOMID] and [JY_FWID]=[FW_ID] '
+ 'and [JY_DATE]>=#' + datetostr(sdate) + '# and [JY_DATE]<=#' + datetostr(edate+1) + '#'
+ ' and [JY_ALLDOLLOR]>' + inttostr(smoney) + ' and [JY_ALLDOLLOR]<' + inttostr(emoney));
recordset_temp.Open ;
for i:=1 to recordset_temp.RecordCount do
begin
listitem:=listview1.Items.Add ;
listitem.Caption :=recordset_temp.Fields[1].AsString ;
listitem.ImageIndex :=0;
listitem.SubItems.Add(format( '%8.2f¥',[recordset_temp.fields[2].AsFloat]));
listitem.SubItems.Add(inttostr(recordset_temp.Fields[3].asinteger));
listitem.SubItems.Add(format( '%8.2f¥',[recordset_temp.fields[4].AsFloat]));
listitem.SubItems.Add(datetostr(recordset_temp.Fields[5].asdatetime));
new(p);
p^ := recordset_temp.Fields[0].AsInteger ;
listitem.Data :=p;
recordset_temp2.Insert ;
recordset_temp2.Fields [1].AsString :=recordset_temp.Fields[1].AsString ;
recordset_temp2.Fields [2].AsString :=format( '%8.2f¥',[recordset_temp.fields[2].AsFloat]);
recordset_temp2.Fields [3].AsString :=inttostr(recordset_temp.Fields[3].asinteger);
recordset_temp2.Fields [4].AsString :=format( '%8.2f¥',[recordset_temp.fields[4].AsFloat]);
recordset_temp2.Fields [5].AsString :=datetostr(recordset_temp.Fields[5].asdatetime);
recordset_temp2.Fields[6].AsString :=recordset_temp.fields[6].AsString ;
recordset_temp2.Post ;
recordset_temp.Next;
end;
recordset_temp.Close;
recordset_temp2.Close ;
end;
procedure Tform_report_jy.BitBtn3Click(Sender: TObject);
begin
close;
end;
procedure Tform_report_jy.ListView1Click(Sender: TObject);
var
p:^integer;
begin
//view the custom information 2002-1-31pm
if listview1.selected=nil then
begin
label4.Caption :='';
label5.Caption :='';
label7.Caption :='';
label10.Caption :='';
label12.Caption :='';
label14.Caption :='';
label15.Caption :='';
label17.Caption :='';
label19.Caption :='';
exit;
end;
p:=listview1.Selected.Data;
//show the custom's information
recordset_temp.SQL.Clear;
recordset_temp.SQL.Add('select [CUSTOM_CODE],[CUSTOM_MNAME],[CUSTOM_FNAME],[CUSTOM_TEL]'
+ ',[AREA_NAME],[CUSTOM_ADD],[FROM_NAME],[CUSTOM_POST],[CUSTOM_DATE] from [JY],[CUSTOM],[AREA],[FROM] where [FROM_ID]=[CUSTOM_FROM] and [AREA_ID]=[CUSTOM_AREA] and [JY_ID]=' + inttostr(p^)
+ ' and [JY_CUSTOMID]=[CUSTOM_ID]');
recordset_temp.Open ;
if recordset_temp.recordcount<>0 then
begin
label4.Caption :=recordset_temp.Fields[0].AsString ;
label5.Caption :=recordset_temp.Fields[1].AsString;
label7.Caption :=recordset_temp.Fields[2].AsString;
label10.Caption :=recordset_temp.Fields[3].AsString;
label12.Caption :=recordset_temp.Fields[4].AsString;
label14.Caption :=recordset_temp.Fields [5].AsString ;
label15.Caption :=recordset_temp.Fields [6].AsString;
label17.Caption :=recordset_temp.Fields [7].AsString;
label19.Caption :=datetostr(recordset_temp.Fields [8].AsDateTime );
end;
end;
procedure Tform_report_jy.BitBtn4Click(Sender: TObject);
begin
recordset_temp2.SQL.Clear ;
recordset_temp2.SQL.Add('select * from [JP]');
recordset_temp2.Open ;
qrdbtext1.DataField :='JP_NAME';
qrdbtext2.DataField :='JP_DOLLOR';
qrdbtext3.DataField :='JP_COUNT';
qrdbtext4.DataField :='JP_AMONEY';
qrdbtext5.DataField :='JP_DATE';
qrdbtext6.DataField :='JP_CODE';
quickrep1.Preview ;
recordset_temp2.Close ;
end;
procedure Tform_report_jy.BitBtn5Click(Sender: TObject);
begin
recordset_temp2.SQL.Clear ;
recordset_temp2.SQL.Add('select * from [JP]');
recordset_temp2.Open ;
qrdbtext1.DataField :='JP_NAME';
qrdbtext2.DataField :='JP_DOLLOR';
qrdbtext3.DataField :='JP_COUNT';
qrdbtext4.DataField :='JP_AMONEY';
qrdbtext5.DataField :='JP_DATE';
qrdbtext6.DataField :='JP_CODE';
quickrep1.Print ;
recordset_temp2.Close ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -