unit u_rp_rp_total; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, RxMemDS, DB, ADODB, Menus, XPMenu, bsSkinCtrls, dxDBGrid, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxCntner, ComCtrls, bsSkinTabs, ExtCtrls; type Tfrm_rp_rp_total = class(TForm) Panel1: TPanel; bsSkinPanel2: TbsSkinPanel; bsSkinButton10: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton5: TbsSkinButton; p_seae: TADOStoredProc; p_seae1: TDataSource; t_sum1: TDataSource; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinTabSheet3: TbsSkinTabSheet; bsSkinTabSheet4: TbsSkinTabSheet; bsSkinTabSheet5: TbsSkinTabSheet; bsSkinTabSheet6: TbsSkinTabSheet; p_seai: TADOStoredProc; p_seai1: TDataSource; p_airi1: TDataSource; p_airi: TADOStoredProc; p_aire: TADOStoredProc; p_aire1: TDataSource; bsSkinPageControl2: TbsSkinPageControl; bsSkinTabSheet11: TbsSkinTabSheet; bsSkinTabSheet12: TbsSkinTabSheet; bsSkinTabSheet13: TbsSkinTabSheet; bsSkinTabSheet14: TbsSkinTabSheet; dxDBGrid1: TdxDBGrid; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridDateColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridMaskColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column21: TdxDBGridMaskColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridMaskColumn; dxDBGrid1Column25: TdxDBGridMaskColumn; dxDBGrid1Column26: TdxDBGridDateColumn; dxDBGrid1Column27: TdxDBGridDateColumn; dxDBGrid1Column28: TdxDBGridDateColumn; dxDBGrid1Column29: TdxDBGridMaskColumn; dxDBGrid1Column31: TdxDBGridMaskColumn; dxDBGrid1Column43: TdxDBGridMaskColumn; dxDBGrid1Column51: TdxDBGridMaskColumn; dxDBGrid1Column54: TdxDBGridMaskColumn; dxDBGrid1Column55: TdxDBGridMaskColumn; dxDBGrid1Column56: TdxDBGridColumn; dxDBGrid1Column57: TdxDBGridColumn; dxDBGrid11: TdxDBGridMaskColumn; dxDBGrid12: TdxDBGridMaskColumn; dxDBGrid13: TdxDBGridMaskColumn; dxDBGrid14: TdxDBGridMaskColumn; dxDBGrid15: TdxDBGridMaskColumn; dxDBGrid16: TdxDBGridMaskColumn; dxDBGrid17: TdxDBGridMaskColumn; dxDBGrid18: TdxDBGridMaskColumn; dxDBGrid19: TdxDBGridMaskColumn; dxDBGrid110: TdxDBGridMaskColumn; dxDBGrid1Column80: TdxDBGridMaskColumn; dxDBGrid1TEU: TdxDBGridMaskColumn; dxDBGrid1Column82: TdxDBGridMaskColumn; dxDBGrid1Column83: TdxDBGridMaskColumn; dxDBGrid1Column84: TdxDBGridDateColumn; dxDBGrid1Column88: TdxDBGridMaskColumn; dxDBGrid1Column89: TdxDBGridMaskColumn; dxDBGrid1Column90: TdxDBGridMaskColumn; dxDBGrid1Column92: TdxDBGridMaskColumn; dxDBGrid1Column93: TdxDBGridMaskColumn; dxDBGrid1Column85: TdxDBGridMaskColumn; dxDBGrid1Column87: TdxDBGridMaskColumn; dxDBGrid1Column86: TdxDBGridMaskColumn; dxDBGrid1USD: TdxDBGridColumn; dxDBGrid1RMB: TdxDBGridColumn; dxDBGrid1Column102: TdxDBGridColumn; dxDBGrid1Column105: TdxDBGridColumn; dxDBGrid1Column108: TdxDBGridColumn; dxDBGrid1Column111: TdxDBGridColumn; dxDBGrid1Column114: TdxDBGridColumn; dxDBGrid1Column115: TdxDBGridColumn; dxDBGrid1Column116: TdxDBGridColumn; dxDBGrid1Column117: TdxDBGridMaskColumn; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridMaskColumn11: TdxDBGridMaskColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridColumn1: TdxDBGridColumn; dxDBGridColumn2: TdxDBGridColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGridMaskColumn21: TdxDBGridMaskColumn; dxDBGridMaskColumn22: TdxDBGridMaskColumn; dxDBGridMaskColumn23: TdxDBGridMaskColumn; dxDBGridMaskColumn24: TdxDBGridMaskColumn; dxDBGridMaskColumn25: TdxDBGridMaskColumn; dxDBGridMaskColumn26: TdxDBGridMaskColumn; dxDBGridMaskColumn27: TdxDBGridMaskColumn; dxDBGridMaskColumn38: TdxDBGridMaskColumn; dxDBGridMaskColumn39: TdxDBGridMaskColumn; dxDBGridMaskColumn40: TdxDBGridMaskColumn; dxDBGridMaskColumn41: TdxDBGridMaskColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridMaskColumn42: TdxDBGridMaskColumn; dxDBGridMaskColumn43: TdxDBGridMaskColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn46: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGridMaskColumn49: TdxDBGridMaskColumn; dxDBGridColumn3: TdxDBGridColumn; dxDBGridColumn4: TdxDBGridColumn; dxDBGridColumn5: TdxDBGridColumn; dxDBGridColumn6: TdxDBGridColumn; dxDBGridColumn7: TdxDBGridColumn; dxDBGridColumn8: TdxDBGridColumn; dxDBGridColumn9: TdxDBGridColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGridColumn11: TdxDBGridColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGrid3: TdxDBGrid; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridMaskColumn52: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn54: TdxDBGridMaskColumn; dxDBGridMaskColumn55: TdxDBGridMaskColumn; dxDBGridMaskColumn56: TdxDBGridMaskColumn; dxDBGridMaskColumn57: TdxDBGridMaskColumn; dxDBGridMaskColumn58: TdxDBGridMaskColumn; dxDBGridMaskColumn59: TdxDBGridMaskColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridMaskColumn60: TdxDBGridMaskColumn; dxDBGridMaskColumn61: TdxDBGridMaskColumn; dxDBGridMaskColumn62: TdxDBGridMaskColumn; dxDBGridMaskColumn63: TdxDBGridMaskColumn; dxDBGridColumn12: TdxDBGridColumn; dxDBGridMaskColumn64: TdxDBGridMaskColumn; dxDBGridMaskColumn65: TdxDBGridMaskColumn; dxDBGridMaskColumn66: TdxDBGridMaskColumn; dxDBGridDateColumn6: TdxDBGridDateColumn; dxDBGridMaskColumn67: TdxDBGridMaskColumn; dxDBGridMaskColumn68: TdxDBGridMaskColumn; dxDBGridMaskColumn69: TdxDBGridMaskColumn; dxDBGridColumn13: TdxDBGridColumn; dxDBGridColumn14: TdxDBGridColumn; dxDBGridColumn15: TdxDBGridColumn; dxDBGridColumn16: TdxDBGridColumn; dxDBGridColumn17: TdxDBGridColumn; dxDBGridColumn18: TdxDBGridColumn; dxDBGridColumn19: TdxDBGridColumn; dxDBGridColumn20: TdxDBGridColumn; dxDBGridColumn21: TdxDBGridColumn; dxDBGridMaskColumn70: TdxDBGridMaskColumn; dxDBGrid4: TdxDBGrid; dxDBGridMaskColumn71: TdxDBGridMaskColumn; dxDBGridMaskColumn72: TdxDBGridMaskColumn; dxDBGridMaskColumn73: TdxDBGridMaskColumn; dxDBGridDateColumn7: TdxDBGridDateColumn; dxDBGridMaskColumn74: TdxDBGridMaskColumn; dxDBGridMaskColumn75: TdxDBGridMaskColumn; dxDBGridMaskColumn76: TdxDBGridMaskColumn; dxDBGridMaskColumn77: TdxDBGridMaskColumn; dxDBGridMaskColumn78: TdxDBGridMaskColumn; dxDBGridMaskColumn79: TdxDBGridMaskColumn; dxDBGridDateColumn8: TdxDBGridDateColumn; dxDBGridMaskColumn80: TdxDBGridMaskColumn; dxDBGridMaskColumn81: TdxDBGridMaskColumn; dxDBGridMaskColumn82: TdxDBGridMaskColumn; dxDBGridMaskColumn83: TdxDBGridMaskColumn; dxDBGridColumn22: TdxDBGridColumn; dxDBGridMaskColumn84: TdxDBGridMaskColumn; dxDBGridMaskColumn85: TdxDBGridMaskColumn; dxDBGridMaskColumn86: TdxDBGridMaskColumn; dxDBGridDateColumn9: TdxDBGridDateColumn; dxDBGridMaskColumn87: TdxDBGridMaskColumn; dxDBGridMaskColumn88: TdxDBGridMaskColumn; dxDBGridMaskColumn89: TdxDBGridMaskColumn; dxDBGridColumn23: TdxDBGridColumn; dxDBGridColumn24: TdxDBGridColumn; dxDBGridColumn25: TdxDBGridColumn; dxDBGridColumn26: TdxDBGridColumn; dxDBGridColumn27: TdxDBGridColumn; dxDBGridColumn28: TdxDBGridColumn; dxDBGridColumn29: TdxDBGridColumn; dxDBGridColumn30: TdxDBGridColumn; dxDBGridColumn31: TdxDBGridColumn; dxDBGridMaskColumn90: TdxDBGridMaskColumn; dxDBGrid5: TdxDBGrid; dxDBGrid2Column1: TdxDBGridMaskColumn; dxDBGrid2Column2: TdxDBGridMaskColumn; dxDBGrid2USD: TdxDBGridColumn; dxDBGrid2Column29: TdxDBGridColumn; dxDBGrid2Column30: TdxDBGridColumn; dxDBGrid2RMB: TdxDBGridColumn; dxDBGrid2Column32: TdxDBGridColumn; dxDBGrid2Column33: TdxDBGridColumn; dxDBGrid2Column34: TdxDBGridColumn; dxDBGrid2Column35: TdxDBGridColumn; dxDBGrid2Column36: TdxDBGridColumn; dxDBGrid2Column37: TdxDBGridColumn; dxDBGrid5Column14: TdxDBGridColumn; dxDBGrid6: TdxDBGrid; dxDBGridMaskColumn91: TdxDBGridMaskColumn; dxDBGridColumn32: TdxDBGridColumn; dxDBGridMaskColumn92: TdxDBGridMaskColumn; dxDBGridColumn34: TdxDBGridColumn; dxDBGridColumn35: TdxDBGridColumn; dxDBGridColumn36: TdxDBGridColumn; dxDBGridColumn37: TdxDBGridColumn; dxDBGridColumn38: TdxDBGridColumn; dxDBGridColumn39: TdxDBGridColumn; dxDBGridColumn40: TdxDBGridColumn; dxDBGridColumn41: TdxDBGridColumn; dxDBGridColumn42: TdxDBGridColumn; dxDBGridColumn43: TdxDBGridColumn; dxDBGrid7: TdxDBGrid; dxDBGridMaskColumn93: TdxDBGridMaskColumn; dxDBGridColumn44: TdxDBGridColumn; dxDBGridMaskColumn94: TdxDBGridMaskColumn; dxDBGridColumn46: TdxDBGridColumn; dxDBGridColumn47: TdxDBGridColumn; dxDBGridColumn48: TdxDBGridColumn; dxDBGridColumn49: TdxDBGridColumn; dxDBGridColumn50: TdxDBGridColumn; dxDBGridColumn51: TdxDBGridColumn; dxDBGridColumn52: TdxDBGridColumn; dxDBGridColumn53: TdxDBGridColumn; dxDBGridColumn54: TdxDBGridColumn; dxDBGridColumn55: TdxDBGridColumn; dxDBGrid8: TdxDBGrid; dxDBGridMaskColumn95: TdxDBGridMaskColumn; dxDBGridColumn56: TdxDBGridColumn; dxDBGridMaskColumn96: TdxDBGridMaskColumn; dxDBGridColumn58: TdxDBGridColumn; dxDBGridColumn59: TdxDBGridColumn; dxDBGridColumn60: TdxDBGridColumn; dxDBGridColumn61: TdxDBGridColumn; dxDBGridColumn62: TdxDBGridColumn; dxDBGridColumn63: TdxDBGridColumn; dxDBGridColumn64: TdxDBGridColumn; dxDBGridColumn65: TdxDBGridColumn; dxDBGridColumn66: TdxDBGridColumn; dxDBGridColumn67: TdxDBGridColumn; dxDBGrid9: TdxDBGrid; dxDBGridMaskColumn97: TdxDBGridMaskColumn; dxDBGridColumn68: TdxDBGridColumn; dxDBGridMaskColumn98: TdxDBGridMaskColumn; dxDBGridColumn70: TdxDBGridColumn; dxDBGridColumn71: TdxDBGridColumn; dxDBGridColumn72: TdxDBGridColumn; dxDBGridColumn73: TdxDBGridColumn; dxDBGridColumn74: TdxDBGridColumn; dxDBGridColumn75: TdxDBGridColumn; dxDBGridColumn76: TdxDBGridColumn; dxDBGridColumn77: TdxDBGridColumn; dxDBGridColumn78: TdxDBGridColumn; dxDBGridColumn79: TdxDBGridColumn; dxDBGrid1Column68: TdxDBGridColumn; dxDBGrid1Column69: TdxDBGridColumn; dxDBGrid2Column65: TdxDBGridColumn; dxDBGrid2Column66: TdxDBGridColumn; dxDBGrid3Column34: TdxDBGridColumn; dxDBGrid3Column35: TdxDBGridColumn; dxDBGrid4Column34: TdxDBGridColumn; dxDBGrid4Column35: TdxDBGridColumn; p_sum: TADOStoredProc; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; XPMenu2: TXPMenu; dxDBGrid5Column15: TdxDBGridColumn; dxDBGrid5Column16: TdxDBGridColumn; dxDBGrid5Column17: TdxDBGridColumn; dxDBGrid5Column18: TdxDBGridColumn; dxDBGrid5Column19: TdxDBGridColumn; dxDBGrid5Column20: TdxDBGridColumn; dxDBGrid5Column21: TdxDBGridColumn; dxDBGrid5Column22: TdxDBGridColumn; dxDBGrid5Column23: TdxDBGridColumn; dxDBGrid5Column24: TdxDBGridColumn; dxDBGrid5Column25: TdxDBGridColumn; dxDBGrid6Column14: TdxDBGridColumn; dxDBGrid6Column15: TdxDBGridColumn; dxDBGrid6Column16: TdxDBGridColumn; dxDBGrid6Column17: TdxDBGridColumn; dxDBGrid6Column18: TdxDBGridColumn; dxDBGrid6Column19: TdxDBGridColumn; dxDBGrid6Column20: TdxDBGridColumn; dxDBGrid6Column21: TdxDBGridColumn; dxDBGrid6Column22: TdxDBGridColumn; dxDBGrid6Column23: TdxDBGridColumn; dxDBGrid6Column24: TdxDBGridColumn; dxDBGrid7Column14: TdxDBGridColumn; dxDBGrid7Column15: TdxDBGridColumn; dxDBGrid7Column16: TdxDBGridColumn; dxDBGrid7Column17: TdxDBGridColumn; dxDBGrid7Column18: TdxDBGridColumn; dxDBGrid7Column19: TdxDBGridColumn; dxDBGrid7Column20: TdxDBGridColumn; dxDBGrid7Column21: TdxDBGridColumn; dxDBGrid7Column22: TdxDBGridColumn; dxDBGrid7Column23: TdxDBGridColumn; dxDBGrid7Column24: TdxDBGridColumn; dxDBGrid8Column14: TdxDBGridColumn; dxDBGrid8Column15: TdxDBGridColumn; dxDBGrid8Column16: TdxDBGridColumn; dxDBGrid8Column17: TdxDBGridColumn; dxDBGrid8Column18: TdxDBGridColumn; dxDBGrid8Column19: TdxDBGridColumn; dxDBGrid8Column20: TdxDBGridColumn; dxDBGrid8Column21: TdxDBGridColumn; dxDBGrid8Column22: TdxDBGridColumn; dxDBGrid8Column23: TdxDBGridColumn; dxDBGrid8Column24: TdxDBGridColumn; dxDBGrid9Column14: TdxDBGridColumn; dxDBGrid9Column15: TdxDBGridColumn; dxDBGrid9Column16: TdxDBGridColumn; dxDBGrid9Column17: TdxDBGridColumn; dxDBGrid9Column18: TdxDBGridColumn; dxDBGrid9Column19: TdxDBGridColumn; dxDBGrid9Column20: TdxDBGridColumn; dxDBGrid9Column21: TdxDBGridColumn; dxDBGrid9Column22: TdxDBGridColumn; dxDBGrid9Column23: TdxDBGridColumn; dxDBGrid9Column24: TdxDBGridColumn; bskntbsht1: TbsSkinTabSheet; bsSkinTabSheet8: TbsSkinTabSheet; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure Panel1Resize(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure bsSkinPageControl1Change(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure sum_do(str:string); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(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); procedure dxDBGrid4ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid5ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid6ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid7ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid8ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid9ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); private { Private declarations } public { Public declarations } end; var frm_rp_rp_total: Tfrm_rp_rp_total; rp_rp_total_open:boolean; implementation uses u_main, my_sys_function, u_rp_query, u_sys_progress, u_data_share; {$R *.dfm} procedure Tfrm_rp_rp_total.sum_do(str:string); begin { try if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(application); frm_sys_progress.Show; frm_sys_progress.bsSkinGauge1.MaxValue:=p_seae.RecordCount +p_seai.RecordCount+p_aire.RecordCount+p_airi.RecordCount; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; frm_sys_progress.Update; p_seae.first; while not p_seae.eof do begin if not t_sum.Locate('基准','海运出口'+p_seae.fieldbyname(str).asstring,[])then begin t_sum.insert; t_sum['统计标准']:=str; t_sum['业务种类']:='海运出口'; t_sum['base']:=p_seae.fieldbyname(str).asstring; t_sum['票数']:=1; t_sum['基准']:='海运出口'+p_seae.fieldbyname(str).asstring; t_sum['应收USD']:=p_seae.fieldbyname('应收USD').asfloat; t_sum['应付USD']:=p_seae.fieldbyname('应付USD').asfloat; t_sum['利润USD']:=p_seae.fieldbyname('利润USD').asfloat; t_sum['应收RMB']:=p_seae.fieldbyname('应收RMB').asfloat; t_sum['应付RMB']:=p_seae.fieldbyname('应付RMB').asfloat; t_sum['利润RMB']:=p_seae.fieldbyname('利润RMB').asfloat; t_sum['合计应收']:=p_seae.fieldbyname('合计应收').asfloat; t_sum['合计应付']:=p_seae.fieldbyname('合计应付').asfloat; t_sum['毛利润']:=p_seae.fieldbyname('毛利润').asfloat; t_sum.post; end else begin t_sum.edit; t_sum['票数']:=t_sum['票数']+1; t_sum['应收USD']:=t_sum['应收USD']+p_seae.fieldbyname('应收USD').asfloat; t_sum['应付USD']:=t_sum['应付USD']+p_seae.fieldbyname('应付USD').asfloat; t_sum['利润USD']:=t_sum['利润USD']+p_seae.fieldbyname('利润USD').asfloat; t_sum['应收RMB']:=t_sum['应收RMB']+p_seae.fieldbyname('应收RMB').asfloat; t_sum['应付RMB']:=t_sum['利润RMB']+p_seae.fieldbyname('应付RMB').asfloat; t_sum['利润RMB']:=t_sum['利润RMB']+p_seae.fieldbyname('利润RMB').asfloat; t_sum['合计应收']:=t_sum['合计应收']+p_seae.fieldbyname('合计应收').asfloat; t_sum['合计应付']:=t_sum['合计应付']+p_seae.fieldbyname('合计应付').asfloat; t_sum['毛利润']:=t_sum['毛利润']+p_seae.fieldbyname('毛利润').asfloat; t_sum.post; end; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; p_seae.next; end; p_seai.first; while not p_seai.eof do begin if not t_sum.Locate('基准','海运进口'+p_seai.fieldbyname(str).asstring,[])then begin t_sum.insert; t_sum['统计标准']:=str; t_sum['业务种类']:='海运进口'; t_sum['base']:=p_seai.fieldbyname(str).asstring; t_sum['票数']:=1; t_sum['基准']:='海运进口'+p_seai.fieldbyname(str).asstring; t_sum['应收USD']:=p_seai.fieldbyname('应收USD').asfloat; t_sum['应付USD']:=p_seai.fieldbyname('应付USD').asfloat; t_sum['利润USD']:=p_seai.fieldbyname('利润USD').asfloat; t_sum['应收RMB']:=p_seai.fieldbyname('应收RMB').asfloat; t_sum['应付RMB']:=p_seai.fieldbyname('应付RMB').asfloat; t_sum['利润RMB']:=p_seai.fieldbyname('利润RMB').asfloat; t_sum['合计应收']:=p_seai.fieldbyname('合计应收').asfloat; t_sum['合计应付']:=p_seai.fieldbyname('合计应付').asfloat; t_sum['毛利润']:=p_seai.fieldbyname('毛利润').asfloat; t_sum.post; end else begin t_sum.edit; t_sum['票数']:=t_sum['票数']+1; t_sum['应收USD']:=t_sum['应收USD']+p_seai.fieldbyname('应收USD').asfloat; t_sum['应付USD']:=t_sum['应付USD']+p_seai.fieldbyname('应付USD').asfloat; t_sum['利润USD']:=t_sum['利润USD']+p_seai.fieldbyname('利润USD').asfloat; t_sum['应收RMB']:=t_sum['应收RMB']+p_seai.fieldbyname('应收RMB').asfloat; t_sum['应付RMB']:=t_sum['利润RMB']+p_seai.fieldbyname('应付RMB').asfloat; t_sum['利润RMB']:=t_sum['利润RMB']+p_seai.fieldbyname('利润RMB').asfloat; t_sum['合计应收']:=t_sum['合计应收']+p_seai.fieldbyname('合计应收').asfloat; t_sum['合计应付']:=t_sum['合计应付']+p_seai.fieldbyname('合计应付').asfloat; t_sum['毛利润']:=t_sum['毛利润']+p_seai.fieldbyname('毛利润').asfloat; t_sum.post; end; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; p_seai.next; end; p_aire.first; while not p_aire.eof do begin if not t_sum.Locate('基准','空运出口'+p_aire.fieldbyname(str).asstring,[])then begin t_sum.insert; t_sum['统计标准']:=str; t_sum['业务种类']:='空运出口'; t_sum['base']:=p_aire.fieldbyname(str).asstring; t_sum['票数']:=1; t_sum['基准']:='空运出口'+p_aire.fieldbyname(str).asstring; t_sum['应收USD']:=p_aire.fieldbyname('应收USD').asfloat; t_sum['应付USD']:=p_aire.fieldbyname('应付USD').asfloat; t_sum['利润USD']:=p_aire.fieldbyname('利润USD').asfloat; t_sum['应收RMB']:=p_aire.fieldbyname('应收RMB').asfloat; t_sum['应付RMB']:=p_aire.fieldbyname('应付RMB').asfloat; t_sum['利润RMB']:=p_aire.fieldbyname('利润RMB').asfloat; t_sum['合计应收']:=p_aire.fieldbyname('合计应收').asfloat; t_sum['合计应付']:=p_aire.fieldbyname('合计应付').asfloat; t_sum['毛利润']:=p_aire.fieldbyname('毛利润').asfloat; t_sum.post; end else begin t_sum.edit; t_sum['票数']:=t_sum['票数']+1; t_sum['应收USD']:=t_sum['应收USD']+p_aire.fieldbyname('应收USD').asfloat; t_sum['应付USD']:=t_sum['应付USD']+p_aire.fieldbyname('应付USD').asfloat; t_sum['利润USD']:=t_sum['利润USD']+p_aire.fieldbyname('利润USD').asfloat; t_sum['应收RMB']:=t_sum['应收RMB']+p_aire.fieldbyname('应收RMB').asfloat; t_sum['应付RMB']:=t_sum['利润RMB']+p_aire.fieldbyname('应付RMB').asfloat; t_sum['利润RMB']:=t_sum['利润RMB']+p_aire.fieldbyname('利润RMB').asfloat; t_sum['合计应收']:=t_sum['合计应收']+p_aire.fieldbyname('合计应收').asfloat; t_sum['合计应付']:=t_sum['合计应付']+p_aire.fieldbyname('合计应付').asfloat; t_sum['毛利润']:=t_sum['毛利润']+p_aire.fieldbyname('毛利润').asfloat; t_sum.post; end; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; p_aire.next; end; p_airi.first; while not p_airi.eof do begin if not t_sum.Locate('基准','空运进口'+p_airi.fieldbyname(str).asstring,[])then begin t_sum.insert; t_sum['统计标准']:=str; t_sum['业务种类']:='空运进口'; t_sum['base']:=p_airi.fieldbyname(str).asstring; t_sum['票数']:=1; t_sum['基准']:='空运进口'+p_airi.fieldbyname(str).asstring; t_sum['应收USD']:=p_airi.fieldbyname('应收USD').asfloat; t_sum['应付USD']:=p_airi.fieldbyname('应付USD').asfloat; t_sum['利润USD']:=p_airi.fieldbyname('利润USD').asfloat; t_sum['应收RMB']:=p_airi.fieldbyname('应收RMB').asfloat; t_sum['应付RMB']:=p_airi.fieldbyname('应付RMB').asfloat; t_sum['利润RMB']:=p_airi.fieldbyname('利润RMB').asfloat; t_sum['合计应收']:=p_airi.fieldbyname('合计应收').asfloat; t_sum['合计应付']:=p_airi.fieldbyname('合计应付').asfloat; t_sum['毛利润']:=p_airi.fieldbyname('毛利润').asfloat; t_sum.post; end else begin t_sum.edit; t_sum['票数']:=t_sum['票数']+1; t_sum['应收USD']:=t_sum['应收USD']+p_airi.fieldbyname('应收USD').asfloat; t_sum['应付USD']:=t_sum['应付USD']+p_airi.fieldbyname('应付USD').asfloat; t_sum['利润USD']:=t_sum['利润USD']+p_airi.fieldbyname('利润USD').asfloat; t_sum['应收RMB']:=t_sum['应收RMB']+p_airi.fieldbyname('应收RMB').asfloat; t_sum['应付RMB']:=t_sum['利润RMB']+p_airi.fieldbyname('应付RMB').asfloat; t_sum['利润RMB']:=t_sum['利润RMB']+p_airi.fieldbyname('利润RMB').asfloat; t_sum['合计应收']:=t_sum['合计应收']+p_airi.fieldbyname('合计应收').asfloat; t_sum['合计应付']:=t_sum['合计应付']+p_airi.fieldbyname('合计应付').asfloat; t_sum['毛利润']:=t_sum['毛利润']+p_airi.fieldbyname('毛利润').asfloat; t_sum.post; end; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; p_airi.next; end; frm_sys_progress.bsSkinGauge1.MaxValue:=t_sum.RecordCount; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; frm_sys_progress.Update; t_sum.first; while not t_sum.eof do begin t_sum.edit; if t_sum['合计应付']=0 then t_sum['利润率']:='无法计算' else t_sum['利润率']:=percent(t_sum['毛利润']/t_sum['合计应付']); t_sum.post; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; t_sum.next; end; finally frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.MaxValue; frm_sys_progress.free; frm_sys_progress:=nil; end; } end; procedure Tfrm_rp_rp_total.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_rp_rp_total.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption+'1'); savereggrid(dxdbgrid2,caption+'2'); savereggrid(dxdbgrid3,caption+'3'); savereggrid(dxdbgrid4,caption+'4'); savereggrid(dxdbgrid5,caption+'5'); savereggrid(dxdbgrid6,caption+'6'); savereggrid(dxdbgrid7,caption+'7'); savereggrid(dxdbgrid8,caption+'8'); savereggrid(dxdbgrid9,caption+'9'); rp_rp_total_open:=false; frm_rp_rp_total.Hide; frm_rp_rp_total.ManualFloat(frm_rp_rp_total.BoundsRect ); frm_main.freeTabs('frm_rp_rp_total'); action:=cafree; frm_rp_rp_total:=nil; end; procedure Tfrm_rp_rp_total.Panel1Resize(Sender: TObject); begin bsSkinPanel2.Left:=Panel1.Width-bsSkinPanel2.Width; end; procedure Tfrm_rp_rp_total.bsSkinButton10Click(Sender: TObject); begin bsSkinTabSheet1.show; try frm_rp_query:=tfrm_rp_query.Create (self); rp_query_limited:='0037'; rp_query_bs:=2; frm_rp_query.ShowModal; finally frm_rp_query.Free; end; end; procedure Tfrm_rp_rp_total.FormShow(Sender: TObject); begin loadreggrid(dxdbgrid1,true,caption+'1'); loadreggrid(dxdbgrid2,true,caption+'2'); loadreggrid(dxdbgrid3,false,caption+'3'); loadreggrid(dxdbgrid4,false,caption+'4'); loadreggrid(dxdbgrid5,false,caption+'5'); loadreggrid(dxdbgrid6,false,caption+'6'); loadreggrid(dxdbgrid7,false,caption+'7'); loadreggrid(dxdbgrid8,false,caption+'8'); loadreggrid(dxdbgrid9,false,caption+'9'); rp_rp_total_open:=true; end; procedure Tfrm_rp_rp_total.bsSkinPageControl1Change(Sender: TObject); var str:widestring; str_get:widestring; begin // try if not rp_rp_total_open then exit; if not p_seae.Active then exit; IF bsSkinTabSheet1.Showing then exit; // frm_rp_rp_total.sum_do(bsSkinPageControl1.ActivePage.Caption); str:=new_query(p_seae); if str<>'no'then begin str_get:='SELECT COUNT(t_op_seae.编号) as 票数, sum(t_op_gain_main.利润USD) as 利润USD' +', sum(t_op_gain_main.应收USD) as 应收USD, sum( t_op_gain_main.应付USD) as 应付USD, sum(t_op_gain_main.利润RMB) as 利润RMB' +', sum(t_op_gain_main.应收RMB) as 应收RMB, sum( t_op_gain_main.应付RMB) as 应付RMB, sum(t_op_gain_main.毛利润) as 毛利润' +', sum(t_op_gain_main.合计应收) as 合计应收, sum( t_op_gain_main.合计应付) as 合计应付' +',(case when isnull(sum(t_op_gain_main.合计应付),0)=0 then '+''''+'无法计算'+''''+' else ' +'ltrim(str(sum(t_op_gain_main.毛利润)/sum(t_op_gain_main.合计应付)*100,10,2))+'+''''+'%'+''''+' end) as 利润率' +', sum(t_op_seae.箱型1) as 箱型1, sum(t_op_seae.箱型2) as 箱型2, sum(t_op_seae.箱型3) as 箱型3' +', sum(t_op_seae.箱型4) as 箱型4, sum(t_op_seae.箱型5) as 箱型5, sum(t_op_seae.箱型6) as 箱型6' +', sum(t_op_seae.箱型7) as 箱型7, sum(t_op_seae.箱型8) as 箱型8, sum(t_op_seae.箱型9) as 箱型9' +', sum(t_op_seae.箱型10) as 箱型10, sum(t_op_seae.其他箱型) as 其他箱型' +', sum(t_op_seae.箱TEU) as 箱TEU' +',t_op_seae.'+bsSkinPageControl1.ActivePage.Caption+' as base' +','+''''+bsSkinPageControl1.ActivePage.Caption+''''+' as 统计标准' +','+''''+'海运出口'+''''+' as 业务种类' +' FROM t_op_seae inner JOIN' +' t_op_gain_main ON t_op_seae.编号 = t_op_gain_main.编号 ' +str+' group by '+'t_op_seae.'+bsSkinPageControl1.ActivePage.Caption +' union '; str:=new_query(p_seai); str_get:=str_get+'SELECT COUNT(t_op_seai.编号) as 票数, sum(t_op_gain.利润USD) as 利润USD' +', sum(t_op_gain.应收USD) as 应收USD, sum( t_op_gain.应付USD) as 应付USD, sum(t_op_gain.利润RMB) as 利润RMB' +', sum(t_op_gain.应收RMB) as 应收RMB, sum( t_op_gain.应付RMB) as 应付RMB, sum(t_op_gain.毛利润) as 毛利润' +', sum(t_op_gain.合计应收) as 合计应收, sum( t_op_gain.合计应付) as 合计应付' +',(case when isnull(sum(t_op_gain.合计应付),0)=0 then '+''''+'无法计算'+''''+' else ' +'ltrim(str(sum(t_op_gain.毛利润)/sum(t_op_gain.合计应付)*100,10,2))+'+''''+'%'+''''+' end) as 利润率' +', sum(t_op_seai.箱型1) as 箱型1, sum(t_op_seai.箱型2) as 箱型2, sum(t_op_seai.箱型3) as 箱型3' +', sum(t_op_seai.箱型4) as 箱型4, sum(t_op_seai.箱型5) as 箱型5, sum(t_op_seai.箱型6) as 箱型6' +', sum(t_op_seai.箱型7) as 箱型7, sum(t_op_seai.箱型8) as 箱型8, sum(t_op_seai.箱型9) as 箱型9' +', sum(t_op_seai.箱型10) as 箱型10, sum(t_op_seai.其他箱型) as 其他箱型' +', sum(t_op_seai.箱TEU) as 箱TEU' +',t_op_seai.'+bsSkinPageControl1.ActivePage.Caption+' as base' +','+''''+bsSkinPageControl1.ActivePage.Caption+''''+' as 统计标准' +','+''''+'海运进口'+''''+' as 业务种类' +' FROM t_op_seai LEFT JOIN' +' t_op_gain ON t_op_seai.编号 = t_op_gain.编号 ' +str+' group by '+'t_op_seai.'+bsSkinPageControl1.ActivePage.Caption +' union '; str:=new_query(p_aire); str_get:=str_get+'SELECT COUNT(t_op_aire.编号) as 票数, sum(t_op_gain.利润USD) as 利润USD' +', sum(t_op_gain.应收USD) as 应收USD, sum( t_op_gain.应付USD) as 应付USD, sum(t_op_gain.利润RMB) as 利润RMB' +', sum(t_op_gain.应收RMB) as 应收RMB, sum( t_op_gain.应付RMB) as 应付RMB, sum(t_op_gain.毛利润) as 毛利润' +', sum(t_op_gain.合计应收) as 合计应收, sum( t_op_gain.合计应付) as 合计应付' +',(case when isnull(sum(t_op_gain.合计应付),0)=0 then '+''''+'无法计算'+''''+' else ' +'ltrim(str(sum(t_op_gain.毛利润)/sum(t_op_gain.合计应付)*100,10,2))+'+''''+'%'+''''+' end) as 利润率' +', 0 as 箱型1, 0 as 箱型2, 0 as 箱型3' +', 0 as 箱型4, 0 as 箱型5, 0 as 箱型6' +', 0 as 箱型7, 0 as 箱型8, 0 as 箱型9' +', 0 as 箱型10, 0 as 其他箱型' +', 0 as 箱TEU' +',t_op_aire.'+bsSkinPageControl1.ActivePage.Caption+' as base' +','+''''+bsSkinPageControl1.ActivePage.Caption+''''+' as 统计标准' +','+''''+'空运出口'+''''+' as 业务种类' +' FROM t_op_aire LEFT JOIN' +' t_op_gain ON t_op_aire.编号 = t_op_gain.编号 ' +str+' group by '+'t_op_aire.'+bsSkinPageControl1.ActivePage.Caption +' union '; str:=new_query(p_airi); str_get:=str_get+'SELECT COUNT(t_op_airi.编号) as 票数, sum(t_op_gain.利润USD) as 利润USD' +', sum(t_op_gain.应收USD) as 应收USD, sum( t_op_gain.应付USD) as 应付USD, sum(t_op_gain.利润RMB) as 利润RMB' +', sum(t_op_gain.应收RMB) as 应收RMB, sum( t_op_gain.应付RMB) as 应付RMB, sum(t_op_gain.毛利润) as 毛利润' +', sum(t_op_gain.合计应收) as 合计应收, sum( t_op_gain.合计应付) as 合计应付' +',(case when isnull(sum(t_op_gain.合计应付),0)=0 then '+''''+'无法计算'+''''+' else ' +'ltrim(str(sum(t_op_gain.毛利润)/sum(t_op_gain.合计应付)*100,10,2))+'+''''+'%'+''''+' end) as 利润率' +', 0 as 箱型1, 0 as 箱型2, 0 as 箱型3' +', 0 as 箱型4, 0 as 箱型5, 0 as 箱型6' +', 0 as 箱型7, 0 as 箱型8, 0 as 箱型9' +', 0 as 箱型10, 0 as 其他箱型' +', 0 as 箱TEU' +',t_op_airi.'+bsSkinPageControl1.ActivePage.Caption+' as base' +','+''''+bsSkinPageControl1.ActivePage.Caption+''''+' as 统计标准' +','+''''+'空运进口'+''''+' as 业务种类' +' FROM t_op_airi LEFT JOIN' +' t_op_gain ON t_op_airi.编号 = t_op_gain.编号 ' +str+' group by '+'t_op_airi.'+bsSkinPageControl1.ActivePage.Caption; p_sum.close; p_sum.Parameters.ParamByName('SQLStr').Value:=str_get; p_sum.open; end; { except ; end; } end; procedure Tfrm_rp_rp_total.bsSkinButton9Click(Sender: TObject); begin sys_print('业务综合统计',2,nil,nil,nil,nil,p_seae1,p_seai1,p_aire1,p_airi1,t_sum1,nil,nil); end; procedure Tfrm_rp_rp_total.N10Click(Sender: TObject); begin if bsSkinTabSheet1.Showing then begin if bsSkinTabSheet11.Showing then begin update_grid_view_no(dxdbgrid1); exit; end; if bsSkinTabSheet12.Showing then begin update_grid_view_no(dxdbgrid2); exit; end; if bsSkinTabSheet13.Showing then begin update_grid_view_no(dxdbgrid3); exit; end; if bsSkinTabSheet14.Showing then begin update_grid_view_no(dxdbgrid4); exit; end; end; if bsSkinTabSheet2.Showing then begin update_grid_view_no(dxdbgrid5); exit; end; if bsSkinTabSheet3.Showing then begin update_grid_view_no(dxdbgrid6); exit; end; if bsSkinTabSheet4.Showing then begin update_grid_view_no(dxdbgrid7); exit; end; if bsSkinTabSheet5.Showing then begin update_grid_view_no(dxdbgrid8); exit; end; if bsSkinTabSheet6.Showing then begin update_grid_view_no(dxdbgrid9); exit; end; end; procedure Tfrm_rp_rp_total.N14Click(Sender: TObject); begin if bsSkinTabSheet1.Showing then begin if bsSkinTabSheet11.Showing then begin update_grid_view_all(dxdbgrid1); exit; end; if bsSkinTabSheet12.Showing then begin update_grid_view_all(dxdbgrid2); exit; end; if bsSkinTabSheet13.Showing then begin update_grid_view_all(dxdbgrid3); exit; end; if bsSkinTabSheet14.Showing then begin update_grid_view_all(dxdbgrid4); exit; end; end; if bsSkinTabSheet2.Showing then begin update_grid_view_all(dxdbgrid5); exit; end; if bsSkinTabSheet3.Showing then begin update_grid_view_all(dxdbgrid6); exit; end; if bsSkinTabSheet4.Showing then begin update_grid_view_all(dxdbgrid7); exit; end; if bsSkinTabSheet5.Showing then begin update_grid_view_all(dxdbgrid8); exit; end; if bsSkinTabSheet6.Showing then begin update_grid_view_all(dxdbgrid9); exit; end; end; procedure Tfrm_rp_rp_total.N12Click(Sender: TObject); begin if bsSkinTabSheet1.Showing then begin if bsSkinTabSheet11.Showing then begin update_grid(dxdbgrid1,87); exit; end; if bsSkinTabSheet12.Showing then begin update_grid(dxdbgrid2,88); exit; end; if bsSkinTabSheet13.Showing then begin update_grid(dxdbgrid3,89); exit; end; if bsSkinTabSheet14.Showing then begin update_grid(dxdbgrid4,90); exit; end; end; if bsSkinTabSheet2.Showing then begin update_grid(dxdbgrid5,91); exit; end; if bsSkinTabSheet3.Showing then begin update_grid(dxdbgrid6,92); exit; end; if bsSkinTabSheet4.Showing then begin update_grid(dxdbgrid7,93); exit; end; if bsSkinTabSheet5.Showing then begin update_grid(dxdbgrid8,94); exit; end; if bsSkinTabSheet6.Showing then begin update_grid(dxdbgrid9,95); exit; end; end; procedure Tfrm_rp_rp_total.N16Click(Sender: TObject); begin if bsSkinTabSheet1.Showing then begin if bsSkinTabSheet11.Showing then begin grid_save_xls(dxdbgrid1); exit; end; if bsSkinTabSheet12.Showing then begin grid_save_xls(dxdbgrid2); exit; end; if bsSkinTabSheet13.Showing then begin grid_save_xls(dxdbgrid3); exit; end; if bsSkinTabSheet14.Showing then begin grid_save_xls(dxdbgrid4); exit; end; end; if bsSkinTabSheet2.Showing then begin grid_save_xls(dxdbgrid5); exit; end; if bsSkinTabSheet3.Showing then begin grid_save_xls(dxdbgrid6); exit; end; if bsSkinTabSheet4.Showing then begin grid_save_xls(dxdbgrid7); exit; end; if bsSkinTabSheet5.Showing then begin grid_save_xls(dxdbgrid8); exit; end; if bsSkinTabSheet6.Showing then begin grid_save_xls(dxdbgrid9); exit; end; end; procedure Tfrm_rp_rp_total.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_seae,'业务编号'); end; procedure Tfrm_rp_rp_total.dxDBGrid2ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_seai,'业务编号'); end; procedure Tfrm_rp_rp_total.dxDBGrid3ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_aire,'业务编号'); end; procedure Tfrm_rp_rp_total.dxDBGrid4ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_airi,'业务编号'); end; procedure Tfrm_rp_rp_total.dxDBGrid5ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_sum,'base'); end; procedure Tfrm_rp_rp_total.dxDBGrid6ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_sum,'base'); end; procedure Tfrm_rp_rp_total.dxDBGrid7ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_sum,'base'); end; procedure Tfrm_rp_rp_total.dxDBGrid8ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_sum,'base'); end; procedure Tfrm_rp_rp_total.dxDBGrid9ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_sum,'base'); end; end.