📄 urepbrowser.pas
字号:
unit uRepBrowser;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uBaseBrowser, dxExEdtr, Provider, DB, DBClient, ActnList,
ImgList, dxCntner, dxTL, dxDBCtrl, dxDBGrid, StdCtrls, ExtCtrls,
ComCtrls, ToolWin;
type
TRepBrowser = class(TBaseBrowser)
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
private
{ Private declarations }
protected
procedure InitVars; override;
procedure Query; override;
procedure GetList; override;
public
{ Public declarations }
end;
var
RepBrowser: TRepBrowser;
implementation
uses uRepBrowserQryDlg, uDM, uGlobal;
{$R *.dfm}
{ TRepBrowser }
const
CS_RepSQL='SELECT DISTINCTROW 员工.工号, 员工.姓名, Sum(工资计算单明细表.工资) AS [工资] '
+' FROM 员工 INNER JOIN (工资计算单主表 INNER JOIN 工资计算单明细表 ON 工资计算单主表.主键 = 工资计算单明细表.主表主键) ON 员工.主键 = 工资计算单明细表.员工主键 '
+' WHERE %s '
+' GROUP BY 员工.工号, 员工.姓名';
procedure TRepBrowser.GetList;
var
vData:OleVariant;
i:integer;
begin
cdsMast.DisableControls ;
try
if cdsMast.Active then cdsMast.Close ;
DM.GetRecords(Format(CS_RepSQL,[Condition]), vData, i, i);
cdsMast.Data :=vData;
CreateCellCols(cell, cdsMast);
SetAllColumnsCanEdit(cell, False);
finally
cdsMast.EnableControls ;
SetCellAutoWidth(Cell);
end;
end;
procedure TRepBrowser.InitVars;
begin
inherited;
//TableName:='工资计算单主表';
Caption :='工资汇总报表';
lblCaption.Caption :=Caption;
ShowQryDlg:=True;
Condition:=' (1=2) ';
end;
procedure TRepBrowser.Query;
begin
inherited;
if QryDLg=nil then
QryDLg:= TRepBrowserQryDlg.Create (self);
if QryDLg.ShowModal =mrOK then
begin
Condition:= QryDLg.GetCondition ;
GetList;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -