unit u_rp_no_histrytotal; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, ExtCtrls, ComCtrls, bsSkinTabs, DB, ADODB, dxExEdtr, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner; type Tfrm_rp_no_histrytotal = class(TForm) Panel1: TPanel; bsSkinPanel2: TbsSkinPanel; bsSkinButton10: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton1: TbsSkinButton; bsSkinButton5: TbsSkinButton; p_total: TADOStoredProc; p_total1: TDataSource; p_total_client1: TDataSource; p_total_client: TADOStoredProc; p_total_sales: TADOStoredProc; p_total_sales1: TDataSource; SaveDialog: TSaveDialog; bsSkinPageControl4: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinTabSheet3: TbsSkinTabSheet; dxDBGrid1: TdxDBGrid; dxDBGridMaskColumn95: TdxDBGridMaskColumn; dxDBGrid1Column23: TdxDBGridColumn; dxDBGridColumn17: TdxDBGridColumn; dxDBGridColumn18: TdxDBGridColumn; dxDBGridColumn19: TdxDBGridColumn; dxDBGridColumn20: TdxDBGridColumn; dxDBGridColumn21: TdxDBGridColumn; dxDBGridColumn22: TdxDBGridColumn; dxDBGridColumn23: TdxDBGridColumn; dxDBGridColumn24: TdxDBGridColumn; dxDBGridColumn25: TdxDBGridColumn; dxDBGridColumn26: TdxDBGridColumn; dxDBGridColumn27: TdxDBGridColumn; dxDBGridColumn28: TdxDBGridColumn; dxDBGridColumn29: TdxDBGridColumn; dxDBGridColumn30: TdxDBGridColumn; dxDBGridColumn31: TdxDBGridColumn; dxDBGridColumn32: TdxDBGridColumn; dxDBGridColumn33: TdxDBGridColumn; dxDBGridColumn34: TdxDBGridColumn; dxDBGridColumn35: TdxDBGridColumn; dxDBGridColumn36: TdxDBGridColumn; dxDBGridColumn37: TdxDBGridColumn; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn96: TdxDBGridMaskColumn; dxDBGrid2Column23: TdxDBGridColumn; dxDBGridColumn38: TdxDBGridColumn; dxDBGridColumn39: TdxDBGridColumn; dxDBGridColumn40: TdxDBGridColumn; dxDBGridColumn41: TdxDBGridColumn; dxDBGridColumn42: TdxDBGridColumn; dxDBGridColumn43: TdxDBGridColumn; dxDBGridColumn44: TdxDBGridColumn; dxDBGridColumn45: TdxDBGridColumn; dxDBGridColumn46: TdxDBGridColumn; dxDBGridColumn47: TdxDBGridColumn; dxDBGridColumn48: TdxDBGridColumn; dxDBGridColumn49: TdxDBGridColumn; dxDBGridColumn50: TdxDBGridColumn; dxDBGridColumn51: TdxDBGridColumn; dxDBGridColumn52: TdxDBGridColumn; dxDBGridColumn53: TdxDBGridColumn; dxDBGridColumn54: TdxDBGridColumn; dxDBGridColumn55: TdxDBGridColumn; dxDBGridColumn56: TdxDBGridColumn; dxDBGridColumn57: TdxDBGridColumn; dxDBGridColumn58: TdxDBGridColumn; dxDBGrid3: TdxDBGrid; dxDBGrid3Column22: TdxDBGridColumn; dxDBGridColumn59: TdxDBGridColumn; dxDBGridColumn60: TdxDBGridColumn; dxDBGridColumn61: TdxDBGridColumn; dxDBGridColumn62: TdxDBGridColumn; dxDBGridColumn63: TdxDBGridColumn; dxDBGridColumn64: TdxDBGridColumn; dxDBGridColumn65: TdxDBGridColumn; dxDBGridColumn66: TdxDBGridColumn; dxDBGridColumn67: TdxDBGridColumn; dxDBGridColumn68: TdxDBGridColumn; dxDBGridColumn69: TdxDBGridColumn; dxDBGridColumn70: TdxDBGridColumn; dxDBGridColumn71: TdxDBGridColumn; dxDBGridColumn72: TdxDBGridColumn; dxDBGridColumn73: TdxDBGridColumn; dxDBGridColumn74: TdxDBGridColumn; dxDBGridColumn75: TdxDBGridColumn; dxDBGridColumn76: TdxDBGridColumn; dxDBGridColumn77: TdxDBGridColumn; dxDBGridColumn78: TdxDBGridColumn; dxDBGridColumn79: TdxDBGridColumn; bsSkinPanel1: TbsSkinPanel; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure Panel1Resize(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid2ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid3ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); private { Private declarations } public { Public declarations } end; var frm_rp_no_histrytotal: Tfrm_rp_no_histrytotal; implementation uses u_main, my_sys_function, u_rp_no_histry_query; {$R *.dfm} procedure Tfrm_rp_no_histrytotal.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_rp_no_histrytotal.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_rp_no_histrytotal.Hide; frm_rp_no_histrytotal.ManualFloat(frm_rp_no_histrytotal.BoundsRect ); frm_main.freeTabs('frm_rp_no_histrytotal'); action:=cafree; frm_rp_no_histrytotal:=nil; end; procedure Tfrm_rp_no_histrytotal.Panel1Resize(Sender: TObject); var i:integer; begin i:=round(bsSkinPanel2.Width/7); bsSkinButton10.Width:=i; bsSkinButton9.Width:=i; bsSkinButton1.Width:=i; end; procedure Tfrm_rp_no_histrytotal.bsSkinButton10Click(Sender: TObject); begin try frm_rp_no_histry_query:=tfrm_rp_no_histry_query.Create (self); frm_rp_no_histry_query.Caption:='所有欠费历史统计'; no_histry_query_bs:=5; no_histry_query_limited:='0033'; frm_rp_no_histry_query.ShowModal; finally frm_rp_no_histry_query.Free; end; end; procedure Tfrm_rp_no_histrytotal.bsSkinButton1Click(Sender: TObject); begin with SaveDialog do begin DefaultExt :='xls'; Filter := '(*.xls)|*.xls'; if Execute then begin if bsSkinTabSheet1.Showing then dxDBGrid1.SaveToXLS(FileName,true) else if bsSkinTabSheet2.Showing then dxDBGrid2.SaveToXLS(FileName,true) else if bsSkinTabSheet3.Showing then dxDBGrid3.SaveToXLS(FileName,true); end; end; end; procedure Tfrm_rp_no_histrytotal.bsSkinButton9Click(Sender: TObject); begin sys_print('欠费综合分析',2,nil,nil,nil,nil,p_total_client1,p_total_sales1,p_total1,nil,nil,nil,nil); end; procedure Tfrm_rp_no_histrytotal.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_total_client,'客户名称'); end; procedure Tfrm_rp_no_histrytotal.dxDBGrid2ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_total_sales,'客户名称'); end; procedure Tfrm_rp_no_histrytotal.dxDBGrid3ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_total,'业务种类'); end; end.