This commit is contained in:
sgwp 2024-10-22 09:36:09 +08:00
parent da95f3301d
commit 190cb4b08e
8 changed files with 1104 additions and 91 deletions

View File

@ -45,7 +45,7 @@ end;
procedure TfrmBaseInput.FormShow(Sender: TObject); procedure TfrmBaseInput.FormShow(Sender: TObject);
begin begin
if trim(gStructVer)='' then if trim(gStructVer)='' then
fWindowDesign.FormStyleInit10(self,0,ADOQueryBaseTemp,ADOQueryBaseCmd) fWindowDesign.FormStyleInit1(self,0,ADOQueryBaseTemp,ADOQueryBaseCmd)
else else
fWindowDesign.FormStyleInit(self,0,ADOQueryBaseTemp,ADOQueryBaseCmd) ; fWindowDesign.FormStyleInit(self,0,ADOQueryBaseTemp,ADOQueryBaseCmd) ;
end; end;

View File

@ -10,23 +10,7 @@ uses
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator, cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, cxDBData, cxGridLevel, cxClasses, dxDateRanges, dxScrollbarAnnotations, cxDBData, cxGridLevel, cxClasses,
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, cxContainer, cxProgressBar, dxSkinBasic, dxSkinBlack, dxSkinBlue, cxGrid, cxContainer, cxProgressBar, dxSkinBasic;
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkroom, dxSkinDarkSide,
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue;
type type
TfrmBaseList = class(TForm) TfrmBaseList = class(TForm)

View File

@ -0,0 +1,487 @@
object frmMainBaseList: TfrmMainBaseList
Left = 0
Top = 0
Caption = 'frmMainBaseList'
ClientHeight = 538
ClientWidth = 1077
Color = clBtnFace
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = #24494#36719#38597#40657
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 21
object ToolBar3: TToolBar
Tag = 1
Left = 0
Top = 0
Width = 1077
Height = 30
AutoSize = True
ButtonHeight = 30
ButtonWidth = 115
Caption = 'ToolBar1'
GradientEndColor = clWindow
Images = DataLink_schedule.cxImageList_bar
List = True
GradientDrawingOptions = [gdoHotTrack]
ShowCaptions = True
TabOrder = 0
object Trefresh: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #26597#35810
ImageIndex = 8
OnClick = TrefreshClick
end
object Tprint: TToolButton
Left = 71
Top = 0
AutoSize = True
Caption = #23548#20986'Excel'
ImageIndex = 28
OnClick = TprintClick
end
object TprintGrid: TToolButton
Left = 180
Top = 0
AutoSize = True
Caption = #25171#21360
ImageIndex = 21
OnClick = TprintGridClick
end
object TsaveGrid: TToolButton
Left = 251
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 30
OnClick = TsaveGridClick
end
object ToolButton1: TToolButton
Left = 354
Top = 0
AutoSize = True
Caption = #34920#26684#21015#35774#32622
ImageIndex = 16
OnClick = ToolButton1Click
end
object Tclose: TToolButton
Left = 473
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
OnClick = TcloseClick
end
end
object cxGrid1: TcxGrid
Left = 8
Top = 209
Width = 1033
Height = 321
TabOrder = 1
object tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DataSource1
DataController.Filter.AutoDataSetFilter = True
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsData.Deleting = False
OptionsData.DeletingConfirmation = False
OptionsData.Inserting = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
object tv1SSel: TcxGridDBColumn
Caption = #36873#25321
DataBinding.FieldName = 'SSel'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxCheckBoxProperties'
Properties.NullStyle = nssUnchecked
HeaderAlignmentHorz = taCenter
Width = 57
end
object tv1OrderNo: TcxGridDBColumn
Caption = #35746#21333#21495
DataBinding.FieldName = 'OrderNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 102
end
object tv1custName: TcxGridDBColumn
Caption = #23458#25143#21517#31216
DataBinding.FieldName = 'custName'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 106
end
object tv1ConNo: TcxGridDBColumn
Caption = #21512#21516#21495
DataBinding.FieldName = 'ConNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 95
end
object tv1C_Name: TcxGridDBColumn
Caption = #21697#21517#20013#25991
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 86
end
object tv1C_Color: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'C_Color'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 92
end
object tv1C_EColor: TcxGridDBColumn
Caption = #39068#33394'('#33521#25991')'
DataBinding.FieldName = 'C_EColor'
DataBinding.IsNullValueType = True
Options.Editing = False
Width = 95
end
object tv1C_ColorNo: TcxGridDBColumn
Caption = #33394#21495
DataBinding.FieldName = 'C_ColorNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 76
end
object tv1C_Pattern: TcxGridDBColumn
Caption = #33457#22411#33457#21495
DataBinding.FieldName = 'C_Pattern'
DataBinding.IsNullValueType = True
Options.Editing = False
end
object tv1C_StyleNo: TcxGridDBColumn
Caption = #27454#21495
DataBinding.FieldName = 'C_StyleNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
end
object tv1C_Width: TcxGridDBColumn
Caption = #38376#24133'(cm)'
DataBinding.FieldName = 'C_Width'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
end
object tv1C_GramWeight: TcxGridDBColumn
Caption = #20811#37325'(g/'#13217')'
DataBinding.FieldName = 'C_GramWeight'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
end
end
object cxGrid1Level1: TcxGridLevel
GridView = tv1
end
end
object dxLayoutControl_query: TdxLayoutControl
Left = 0
Top = 75
Width = 1077
Height = 45
Align = alTop
TabOrder = 2
AutoSize = True
LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1
OptionsItem.SizableHorz = True
OptionsItem.SizableVert = True
object custName: TcxTextEdit
Tag = 2
Left = 262
Top = 11
Style.HotTrack = False
Style.TransparentBorder = False
TabOrder = 1
Width = 109
end
object ConNo: TcxTextEdit
Tag = 2
Left = 436
Top = 11
Style.HotTrack = False
Style.TransparentBorder = False
TabOrder = 2
Width = 105
end
object OrderNo: TcxTextEdit
Tag = 2
Left = 72
Top = 11
Style.HotTrack = False
Style.TransparentBorder = False
TabOrder = 0
Width = 109
end
object dxLayoutControl_queryGroup_Root: TdxLayoutGroup
AlignHorz = ahParentManaged
AlignVert = avParentManaged
CaptionOptions.AlignVert = tavCenter
SizeOptions.AssignedValues = [sovSizableHorz, sovSizableVert]
SizeOptions.SizableHorz = True
SizeOptions.SizableVert = True
Hidden = True
LayoutDirection = ldHorizontal
Padding.Bottom = -5
Padding.Top = -5
Padding.AssignedValues = [lpavBottom, lpavTop]
ShowBorder = False
Index = -1
end
object dxLayoutItem1: TdxLayoutItem
Parent = dxLayoutControl_queryGroup_Root
CaptionOptions.Text = #35746#21333#21495
Control = OrderNo
ControlOptions.OriginalHeight = 33
ControlOptions.OriginalWidth = 109
ControlOptions.ShowBorder = False
Index = 0
end
object dxLayoutItem2: TdxLayoutItem
Parent = dxLayoutControl_queryGroup_Root
CaptionOptions.Text = #23458#25143#21517#31216
Control = custName
ControlOptions.OriginalHeight = 33
ControlOptions.OriginalWidth = 109
ControlOptions.ShowBorder = False
Index = 1
end
object dxLayoutItem_hth: TdxLayoutItem
Parent = dxLayoutControl_queryGroup_Root
CaptionOptions.Text = #21512#21516#21495
Control = ConNo
ControlOptions.OriginalHeight = 33
ControlOptions.OriginalWidth = 105
ControlOptions.ShowBorder = False
Index = 2
end
end
object Panel_page: TPanel
Left = 0
Top = 120
Width = 1077
Height = 37
Align = alTop
AutoSize = True
BevelInner = bvRaised
BevelOuter = bvLowered
TabOrder = 3
DesignSize = (
1077
37)
object LBCPAP: TLabel
Left = 425
Top = 8
Width = 100
Height = 20
Alignment = taCenter
Anchors = [akLeft]
AutoSize = False
Caption = #24403#21069#39029'/'#24635#39029#25968
Layout = tlCenter
ExplicitTop = 7
end
object Label31: TLabel
Left = 14
Top = 8
Width = 96
Height = 21
Alignment = taCenter
Anchors = [akLeft]
Caption = #27599#39029#35760#24405#26465#25968
Layout = tlCenter
ExplicitTop = 7
end
object BTNP: TButton
Left = 532
Top = 5
Width = 78
Height = 30
Anchors = [akLeft]
Caption = #19979#19968#39029
TabOrder = 0
OnClick = BTNPClick
end
object BTLP: TButton
Left = 338
Top = 4
Width = 78
Height = 31
Anchors = [akLeft]
Caption = #19978#19968#39029
TabOrder = 1
OnClick = BTLPClick
end
object TCBNOR: TcxComboBox
Tag = 2
Left = 122
Top = 2
Properties.DropDownListStyle = lsEditFixedList
Properties.Items.Strings = (
'500'
'1000'
'5000'
'10000')
Properties.OnChange = TCBNORPropertiesChange
TabOrder = 2
Text = '500'
Width = 94
end
end
inline frmFrameDateSel1: TfrmFrameDateSel10
Left = 0
Top = 30
Width = 1077
Height = 45
Align = alTop
AutoSize = True
Color = clBtnFace
ParentBackground = False
ParentColor = False
TabOrder = 4
ExplicitTop = 30
ExplicitWidth = 1077
inherited dxLayoutControl1: TdxLayoutControl
Width = 1077
ExplicitWidth = 1077
inherited BegDate: TcxDateEdit
Left = 116
Top = 11
ExplicitLeft = 116
ExplicitTop = 11
end
inherited EndDate: TcxDateEdit
Left = 265
Top = 11
ExplicitLeft = 265
ExplicitTop = 11
end
inherited cxButton1: TcxButton
Left = 465
Top = 11
ExplicitLeft = 465
ExplicitTop = 11
end
inherited cxButton2: TcxButton
Left = 625
Top = 11
ExplicitLeft = 625
ExplicitTop = 11
end
inherited cxButton3: TcxButton
Left = 756
Top = 11
ExplicitLeft = 756
ExplicitTop = 11
end
inherited cbbType: TcxComboBox
Left = 705
Top = 11
ExplicitLeft = 705
ExplicitTop = 11
end
inherited cxButton4: TcxButton
Left = 385
Top = 11
ExplicitLeft = 385
ExplicitTop = 11
end
inherited cxButton5: TcxButton
Left = 545
Top = 11
ExplicitLeft = 545
ExplicitTop = 11
end
inherited TimeType: TcxComboBox
Left = 16
Top = 11
ExplicitLeft = 16
ExplicitTop = 11
end
inherited jqModel: TcxCheckBox
Left = 859
Top = 11
ExplicitLeft = 859
ExplicitTop = 11
ExplicitWidth = 82
ExplicitHeight = 25
end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
ItemIndex = 1
end
inherited dxLayoutItem1: TdxLayoutItem
CaptionOptions.Text = 'New Item'
end
inherited dxLayoutItem2: TdxLayoutItem
CaptionOptions.Text = 'New Item'
end
inherited dxLayoutItem8: TdxLayoutItem
CaptionOptions.Text = 'New Item'
end
inherited dxLayoutItem9: TdxLayoutItem
CaptionOptions.Text = 'New Item'
end
inherited dxLayoutItem10: TdxLayoutItem
ControlOptions.OriginalHeight = 25
ControlOptions.OriginalWidth = 82
end
end
end
object DataSource1: TDataSource
DataSet = CDS_List
Left = 768
Top = 296
end
object ADOQueryList: TADOQuery
Connection = DataLink_schedule.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 704
Top = 368
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid1
PopupMenus = <>
Left = 208
Top = 287
end
object ADOQueryBaseCmd: TADOQuery
Parameters = <>
Left = 281
Top = 248
end
object ADOQueryBaseTemp: TADOQuery
LockType = ltReadOnly
Parameters = <>
Left = 201
Top = 225
end
object CDS_List: TClientDataSet
Aggregates = <>
Params = <>
Left = 395
Top = 280
end
end

View File

@ -0,0 +1,380 @@
unit U_MainBaseList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,U_WindowFormdesign,
dxSkinsDefaultPainters, dxSkinWXI, cxStyles, cxCustomData, cxFilter, cxData,
cxDataStorage, cxEdit, cxNavigator, dxDateRanges, dxScrollbarAnnotations,
Data.DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxClasses, cxGridCustomView, cxGrid, Data.Win.ADODB,math,
dxBarBuiltInMenu, cxGridCustomPopupMenu, cxGridPopupMenu, cxCheckBox,
cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer,
cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl,
FrameDateSel, Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls,
cxGeometry, dxFramedControl, dxPanel, FrameDateSel10, dxSkinBasic,
dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
dxSkinDarkroom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinOffice2016Colorful,
dxSkinOffice2016Dark, dxSkinOffice2019Black, dxSkinOffice2019Colorful,
dxSkinOffice2019DarkGray, dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven,
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringtime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinTheBezier, dxSkinValentine, dxSkinVisualStudio2013Blue,
dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010,
dxSkinWhiteprint, dxSkinXmas2008Blue;
type
TfrmMainBaseList = class(TForm)
ToolBar3: TToolBar;
Trefresh: TToolButton;
Tprint: TToolButton;
TprintGrid: TToolButton;
TsaveGrid: TToolButton;
Tclose: TToolButton;
cxGrid1: TcxGrid;
tv1: TcxGridDBTableView;
tv1custName: TcxGridDBColumn;
tv1OrderNo: TcxGridDBColumn;
tv1ConNo: TcxGridDBColumn;
cxGrid1Level1: TcxGridLevel;
DataSource1: TDataSource;
ADOQueryList: TADOQuery;
cxGridPopupMenu1: TcxGridPopupMenu;
ADOQueryBaseCmd: TADOQuery;
ADOQueryBaseTemp: TADOQuery;
tv1C_Name: TcxGridDBColumn;
tv1C_Color: TcxGridDBColumn;
tv1C_ColorNo: TcxGridDBColumn;
tv1C_EColor: TcxGridDBColumn;
tv1C_Pattern: TcxGridDBColumn;
tv1C_StyleNo: TcxGridDBColumn;
tv1C_Width: TcxGridDBColumn;
tv1C_GramWeight: TcxGridDBColumn;
tv1SSel: TcxGridDBColumn;
dxLayoutControl_query: TdxLayoutControl;
custName: TcxTextEdit;
ConNo: TcxTextEdit;
OrderNo: TcxTextEdit;
dxLayoutControl_queryGroup_Root: TdxLayoutGroup;
dxLayoutItem1: TdxLayoutItem;
dxLayoutItem2: TdxLayoutItem;
dxLayoutItem_hth: TdxLayoutItem;
CDS_List: TClientDataSet;
Panel_page: TPanel;
BTNP: TButton;
LBCPAP: TLabel;
BTLP: TButton;
TCBNOR: TcxComboBox;
Label31: TLabel;
frmFrameDateSel1: TfrmFrameDateSel10;
ToolButton1: TToolButton;
procedure TrefreshClick(Sender: TObject);
procedure TprintClick(Sender: TObject);
procedure TprintGridClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TcloseClick(Sender: TObject);
procedure TsaveGridClick(Sender: TObject);
procedure BTLPClick(Sender: TObject);
procedure BTNPClick(Sender: TObject);
procedure TCBNORPropertiesChange(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
private
fWindowDesign: TWindowFormdesign;
CurrentPage, RecordsNumber: Integer;
fDesignCode:string;
procedure doQuery();
procedure doQueryByCriteria();
procedure initGrid();
protected
fParameters1: string;
fParameters2: string;
fParameters3: string;
fParameters4: string;
fParameters5: string;
fParameters10: string;
public
fFormId: integer;
fProcedureName:string; //存储过程名称
FLMType:string; //报表文件类型标志
ftimeType:string; //日期类型
fQueryType:String; //查询类型
FFiltration1:string; //打印参数条件
fCriteria:string; //条件参数
constructor Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
end;
var
frmMainBaseList: TfrmMainBaseList;
implementation
uses
U_RTFun, U_globalVar, U_dataLink,U_FormLayOutDesign, U_LabelPrint;
{$R *.dfm}
procedure TfrmMainBaseList.BTLPClick(Sender: TObject);
begin
if CurrentPage > 1 then
CurrentPage := CurrentPage - 1;
doQuery();
end;
procedure TfrmMainBaseList.BTNPClick(Sender: TObject);
begin
if CurrentPage < cds_List.FieldByName('TotalCount').AsInteger / RecordsNumber then
CurrentPage := CurrentPage + 1;
doQuery();
end;
constructor TfrmMainBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
begin
inherited Create(AOwner);
if ACaption <> '' then
Caption := ACaption;
fParameters1 := Parameters1;
fParameters2 := Parameters2;
fParameters3 := Parameters3;
fParameters4 := Parameters4;
fParameters5 := Parameters5;
fParameters10 := Parameters10;
fFormId:= FormID ;
end;
procedure TfrmMainBaseList.TCBNORPropertiesChange(Sender: TObject);
begin
RecordsNumber := StrToInt(TCBNOR.Text);
CurrentPage := 1;
initGrid();
end;
procedure TfrmMainBaseList.TcloseClick(Sender: TObject);
begin
close;
end;
procedure TfrmMainBaseList.ToolButton1Click(Sender: TObject);
begin
fWindowDesign.OpenGridDesignWin10(fDesignCode,'cxgrid1',tv1);
end;
procedure TfrmMainBaseList.TprintClick(Sender: TObject);
begin
if cds_List.IsEmpty then
Exit;
TcxGridToExcel(self.Caption, cxgrid1);
end;
procedure TfrmMainBaseList.TprintGridClick(Sender: TObject);
begin
if cds_List.IsEmpty then
Exit;
if trim(self.FLMType)='' then
begin
application.MessageBox('未设置打印报表类型,请先设置!','提示信息',0);
exit;
end;
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := self.FLMType;
FFiltration1 := self.FFiltration1;
if ShowModal = 1 then
begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TfrmMainBaseList.TrefreshClick(Sender: TObject);
begin
if frmFrameDateSel1.BegDate.Visible then
begin
frmFrameDateSel1.BegDate.SetFocus;
end;
CurrentPage := 1;
initGrid();
end;
procedure TfrmMainBaseList.TsaveGridClick(Sender: TObject);
begin
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption);
if gIsCanDesign then
begin
saveLayOut(application, dxLayoutControl_query, ADOQueryBaseCmd,PWideChar( fDllFileName + '|' + Self.Name + '|' + dxLayoutControl_query.Name + '.ini'));
end;
end;
////////////////////////////////////
procedure TfrmMainBaseList.doQuery();
var
strwhere: string;
begin
if fProcedureName='' then
begin
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
exit;
end;
strwhere := GetProcedureParam(dxLayoutControl_query);
try
Tv1.BeginUpdate();
CDS_List.DisableControls;
with ADOQueryList do
begin
close;
Filtered := false;
sql.Clear;
sql.Add('exec '+fProcedureName);
sql.Add('@timeType='+quotedstr(fTimeType));
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
if frmFrameDateSel1.jqModel.Checked then
sql.Add(',@jqModel=1')
else
sql.Add(',@jqModel=0');
if Panel_page.Visible then
begin
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
end;
sql.Add(',@criteria='+ quotedstr(fcriteria));
if strwhere<>'' then
sql.Add(','+strwhere);
// showMessage(sql.Text);
//cxMemo1.Text:= sql.Text ;
open;
end;
SCreateCDS(ADOQueryList, CDS_List);
SInitCDSData(ADOQueryList, CDS_List);
if Panel_page.Visible then
begin
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list.FieldByName('TotalCount').AsInteger / RecordsNumber));
end;
finally
CDS_List.EnableControls;
Tv1.EndUpdate;
end;
end;
////////////////////////////////////
procedure TfrmMainBaseList.doQueryByCriteria();
var
mSqlWhere: string;
begin
if fProcedureName='' then
begin
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
exit;
end;
mSqlWhere := SLGetFilters(dxLayoutControl_query, 1, 2);
if trim(mSqlWhere) <> '' then
begin
mSqlWhere := ' and ' + trim(mSqlWhere);
end;
mSqlWhere:=fCriteria + ' ' + mSqlWhere ;
try
Tv1.BeginUpdate();
CDS_List.DisableControls;
with ADOQueryList do
begin
close;
Filtered := false;
sql.Clear;
sql.Add('exec '+fProcedureName);
sql.Add('@timeType='+quotedstr(fTimeType));
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
if Panel_page.Visible then
begin
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
end;
sql.Add(',@criteria='+ quotedstr(mSqlWhere));
//cxMemo1.Text:= sql.Text ;
open;
end;
SCreateCDS(ADOQueryList, CDS_List);
SInitCDSData(ADOQueryList, CDS_List);
if Panel_page.Visible then
begin
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list.FieldByName('TotalCount').AsInteger / RecordsNumber));
end;
finally
CDS_List.EnableControls;
Tv1.EndUpdate;
end;
end;
///
procedure TfrmMainBaseList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Sendmessage(application.MainForm.Handle, WM_CloseForm, 4, 0);
Action:=cafree;
end;
procedure TfrmMainBaseList.FormCreate(Sender: TObject);
begin
cxgrid1.Align:=alClient;
CurrentPage := 1;
RecordsNumber := 500;
fWindowDesign := TWindowFormdesign.Create();
frmFrameDateSel1.begdate.Date:=SGetServerDate(ADOQueryBaseTemp);
frmFrameDateSel1.enddate.Date:=frmFrameDateSel1.begdate.Date;
end;
procedure TfrmMainBaseList.FormDestroy(Sender: TObject);
begin
fWindowDesign.free;
end;
procedure TfrmMainBaseList.FormShow(Sender: TObject);
var
mdesignCode:string;
begin
fDesignCode := fDllFileName +'|'+self.name+ '|' + intTostr(fformId) + '|' + 'cxgrid1';
if DParameters8<>'1' then
begin
fWindowDesign.FormStyleInit(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10);
end;
TgridLiSet.Visible:=gIsCanDesign;
mdesignCode := fDllFileName +'|'+self.name+ '|' + intTostr(fformId) + '|' + 'cxgrid1';
//增加动态条件
addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid1',dxLayoutControl_query,7);
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption);
initGrid();
end;
///////////////////////////////
///
procedure TfrmMainBaseList.initGrid();
begin
if fQueryType='criteria' then
begin
doQueryByCriteria() ;
end
else
begin
frmFrameDateSel1.jqModel.Checked:=true;
doQuery() ;
end;
end;
end.

View File

@ -70,6 +70,7 @@ object frmQryBaseList: TfrmQryBaseList
AutoSize = True AutoSize = True
Caption = #34920#26684#21015#35774#32622 Caption = #34920#26684#21015#35774#32622
ImageIndex = 16 ImageIndex = 16
Visible = False
OnClick = TgridLiSetClick OnClick = TgridLiSetClick
end end
object Tclose: TToolButton object Tclose: TToolButton
@ -128,7 +129,6 @@ object frmQryBaseList: TfrmQryBaseList
OptionsItem.SizableHorz = True OptionsItem.SizableHorz = True
OptionsItem.SizableVert = True OptionsItem.SizableVert = True
OnDblClick = dxLayoutControl_queryDblClick OnDblClick = dxLayoutControl_queryDblClick
ExplicitTop = 73
object dxLayoutControl_queryGroup_Root: TdxLayoutGroup object dxLayoutControl_queryGroup_Root: TdxLayoutGroup
AlignHorz = ahParentManaged AlignHorz = ahParentManaged
AlignVert = avParentManaged AlignVert = avParentManaged
@ -156,62 +156,63 @@ object frmQryBaseList: TfrmQryBaseList
ParentBackground = False ParentBackground = False
ParentColor = False ParentColor = False
TabOrder = 3 TabOrder = 3
ExplicitTop = 30 ExplicitTop = 27
ExplicitWidth = 1077 ExplicitWidth = 1077
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 1077 Width = 1077
inherited TimeType: TcxComboBox [0] ExplicitWidth = 1077
Left = 16 inherited BegDate: TcxDateEdit
Top = 11
ExplicitLeft = 16
ExplicitTop = 11
end
inherited BegDate: TcxDateEdit [1]
Left = 116 Left = 116
Top = 11 Top = 11
ExplicitLeft = 116 ExplicitLeft = 116
ExplicitTop = 11 ExplicitTop = 11
end end
inherited EndDate: TcxDateEdit [2] inherited EndDate: TcxDateEdit
Left = 265 Left = 265
Top = 11 Top = 11
ExplicitLeft = 265 ExplicitLeft = 265
ExplicitTop = 11 ExplicitTop = 11
end end
inherited cxButton4: TcxButton [3] inherited cxButton1: TcxButton
Left = 385
Top = 11
ExplicitLeft = 385
ExplicitTop = 11
end
inherited cxButton1: TcxButton [4]
Left = 465 Left = 465
Top = 11 Top = 11
ExplicitLeft = 465 ExplicitLeft = 465
ExplicitTop = 11 ExplicitTop = 11
end end
inherited cxButton5: TcxButton [5] inherited cxButton2: TcxButton
Left = 545
Top = 11
ExplicitLeft = 545
ExplicitTop = 11
end
inherited cxButton2: TcxButton [6]
Left = 625 Left = 625
Top = 11 Top = 11
ExplicitLeft = 625 ExplicitLeft = 625
ExplicitTop = 11 ExplicitTop = 11
end end
inherited cbbType: TcxComboBox [7] inherited cxButton3: TcxButton
Left = 756
Top = 11
ExplicitLeft = 756
ExplicitTop = 11
end
inherited cbbType: TcxComboBox
Left = 705 Left = 705
Top = 11 Top = 11
ExplicitLeft = 705 ExplicitLeft = 705
ExplicitTop = 11 ExplicitTop = 11
end end
inherited cxButton3: TcxButton [8] inherited cxButton4: TcxButton
Left = 756 Left = 385
Top = 11 Top = 11
ExplicitLeft = 756 ExplicitLeft = 385
ExplicitTop = 11
end
inherited cxButton5: TcxButton
Left = 545
Top = 11
ExplicitLeft = 545
ExplicitTop = 11
end
inherited TimeType: TcxComboBox
Left = 16
Top = 11
ExplicitLeft = 16
ExplicitTop = 11 ExplicitTop = 11
end end
inherited jqModel: TcxCheckBox inherited jqModel: TcxCheckBox
@ -219,8 +220,8 @@ object frmQryBaseList: TfrmQryBaseList
Top = 11 Top = 11
ExplicitLeft = 859 ExplicitLeft = 859
ExplicitTop = 11 ExplicitTop = 11
ExplicitWidth = 89 ExplicitWidth = 82
ExplicitHeight = 33 ExplicitHeight = 25
end end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group_Root: TdxLayoutGroup
ItemIndex = 1 ItemIndex = 1
@ -237,6 +238,10 @@ object frmQryBaseList: TfrmQryBaseList
inherited dxLayoutItem9: TdxLayoutItem inherited dxLayoutItem9: TdxLayoutItem
CaptionOptions.Text = 'New Item' CaptionOptions.Text = 'New Item'
end end
inherited dxLayoutItem10: TdxLayoutItem
ControlOptions.OriginalHeight = 25
ControlOptions.OriginalWidth = 82
end
end end
end end
object Panel_page: TPanel object Panel_page: TPanel
@ -249,7 +254,6 @@ object frmQryBaseList: TfrmQryBaseList
BevelInner = bvRaised BevelInner = bvRaised
BevelOuter = bvLowered BevelOuter = bvLowered
TabOrder = 4 TabOrder = 4
ExplicitTop = 118
DesignSize = ( DesignSize = (
1077 1077
37) 37)

View File

@ -14,7 +14,23 @@ uses
cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer, cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer,
cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl, cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl,
Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls, Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls,
cxGeometry, dxFramedControl, dxPanel, FrameDateSel10; cxGeometry, dxFramedControl, dxPanel, FrameDateSel10, dxSkinBasic,
dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
dxSkinDarkroom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinOffice2016Colorful,
dxSkinOffice2016Dark, dxSkinOffice2019Black, dxSkinOffice2019Colorful,
dxSkinOffice2019DarkGray, dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven,
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringtime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinTheBezier, dxSkinValentine, dxSkinVisualStudio2013Blue,
dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010,
dxSkinWhiteprint, dxSkinXmas2008Blue;
type type
TfrmQryBaseList = class(TForm) TfrmQryBaseList = class(TForm)
@ -326,6 +342,7 @@ begin
begin begin
fWindowDesign.FormStyleInit10(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10); fWindowDesign.FormStyleInit10(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10);
end; end;
TgridLiSet.Visible:=gIsCanDesign;
if dxLayoutControl_query.Tag<>999 then if dxLayoutControl_query.Tag<>999 then
readLayOut(dxLayoutControl_query,ADOQueryBaseTemp,PWideChar( fDllFileName+'|'+self.name+'|'+dxLayoutControl_query.Name+'.ini')); readLayOut(dxLayoutControl_query,ADOQueryBaseTemp,PWideChar( fDllFileName+'|'+self.name+'|'+dxLayoutControl_query.Name+'.ini'));
fWindowDesign.fProcedureName:=fProcedureName; fWindowDesign.fProcedureName:=fProcedureName;

View File

@ -190,6 +190,54 @@ object frmQryPivotBaseList: TfrmQryPivotBaseList
LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1 LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1
OptionsItem.SizableHorz = True OptionsItem.SizableHorz = True
OptionsItem.SizableVert = True OptionsItem.SizableVert = True
object CheckBox_filter: TCheckBox
Tag = 99
Left = 16
Top = 14
Width = 90
Height = 17
Caption = #36807#28388#23383#27573
Color = 16448250
ParentColor = False
TabOrder = 0
OnClick = CheckBox_filterClick
end
object CheckBox_data: TCheckBox
Tag = 99
Left = 115
Top = 14
Width = 92
Height = 17
Caption = #25968#25454#23383#27573
Color = 16448250
ParentColor = False
TabOrder = 1
OnClick = CheckBox_dataClick
end
object CheckBox_row: TCheckBox
Tag = 99
Left = 216
Top = 14
Width = 92
Height = 17
Caption = #34892#23383#27573
Color = 16448250
ParentColor = False
TabOrder = 2
OnClick = CheckBox_rowClick
end
object CheckBox_col: TCheckBox
Tag = 99
Left = 317
Top = 14
Width = 92
Height = 17
Caption = #21015#23383#27573
Color = 16448250
ParentColor = False
TabOrder = 3
OnClick = CheckBox_colClick
end
object dxLayoutControl_queryGroup_Root: TdxLayoutGroup object dxLayoutControl_queryGroup_Root: TdxLayoutGroup
AlignHorz = ahParentManaged AlignHorz = ahParentManaged
AlignVert = avParentManaged AlignVert = avParentManaged
@ -198,19 +246,64 @@ object frmQryPivotBaseList: TfrmQryPivotBaseList
SizeOptions.SizableHorz = True SizeOptions.SizableHorz = True
SizeOptions.SizableVert = True SizeOptions.SizableVert = True
Hidden = True Hidden = True
ItemIndex = 3
LayoutDirection = ldHorizontal LayoutDirection = ldHorizontal
Padding.Bottom = -5 Padding.Bottom = -2
Padding.Top = -5 Padding.Top = -2
Padding.AssignedValues = [lpavBottom, lpavTop] Padding.AssignedValues = [lpavBottom, lpavTop]
ShowBorder = False ShowBorder = False
Index = -1 Index = -1
end end
object dxLayoutItem1: TdxLayoutItem
Parent = dxLayoutControl_queryGroup_Root
CaptionOptions.Text = 'New Item'
CaptionOptions.Visible = False
Control = CheckBox_filter
ControlOptions.AutoColor = True
ControlOptions.OriginalHeight = 17
ControlOptions.OriginalWidth = 90
ControlOptions.ShowBorder = False
Index = 0
end
object dxLayoutItem2: TdxLayoutItem
Parent = dxLayoutControl_queryGroup_Root
CaptionOptions.Text = 'New Item'
CaptionOptions.Visible = False
Control = CheckBox_data
ControlOptions.AutoColor = True
ControlOptions.OriginalHeight = 17
ControlOptions.OriginalWidth = 92
ControlOptions.ShowBorder = False
Index = 1
end
object dxLayoutItem3: TdxLayoutItem
Parent = dxLayoutControl_queryGroup_Root
CaptionOptions.Text = 'New Item'
CaptionOptions.Visible = False
Control = CheckBox_row
ControlOptions.AutoColor = True
ControlOptions.OriginalHeight = 17
ControlOptions.OriginalWidth = 92
ControlOptions.ShowBorder = False
Index = 2
end
object dxLayoutItem4: TdxLayoutItem
Parent = dxLayoutControl_queryGroup_Root
CaptionOptions.Text = 'New Item'
CaptionOptions.Visible = False
Control = CheckBox_col
ControlOptions.AutoColor = True
ControlOptions.OriginalHeight = 17
ControlOptions.OriginalWidth = 92
ControlOptions.ShowBorder = False
Index = 3
end
end end
object Panel_page: TPanel object Panel_page: TPanel
Left = 0 Left = 0
Top = 117 Top = 117
Width = 1037 Width = 1037
Height = 37 Height = 40
Align = alTop Align = alTop
AutoSize = True AutoSize = True
BevelInner = bvRaised BevelInner = bvRaised
@ -218,10 +311,10 @@ object frmQryPivotBaseList: TfrmQryPivotBaseList
TabOrder = 3 TabOrder = 3
DesignSize = ( DesignSize = (
1037 1037
37) 40)
object LBCPAP: TLabel object LBCPAP: TLabel
Left = 425 Left = 425
Top = 8 Top = 11
Width = 100 Width = 100
Height = 20 Height = 20
Alignment = taCenter Alignment = taCenter
@ -229,21 +322,22 @@ object frmQryPivotBaseList: TfrmQryPivotBaseList
AutoSize = False AutoSize = False
Caption = #24403#21069#39029'/'#24635#39029#25968 Caption = #24403#21069#39029'/'#24635#39029#25968
Layout = tlCenter Layout = tlCenter
ExplicitTop = 7 ExplicitTop = 12
end end
object Label31: TLabel object Label31: TLabel
Left = 14 Left = 14
Top = 8 Top = 11
Width = 96 Width = 96
Height = 21 Height = 21
Alignment = taCenter Alignment = taCenter
Anchors = [akLeft] Anchors = [akLeft]
Caption = #27599#39029#35760#24405#26465#25968 Caption = #27599#39029#35760#24405#26465#25968
Layout = tlCenter Layout = tlCenter
ExplicitTop = 12
end end
object BTNP: TButton object BTNP: TButton
Left = 532 Left = 533
Top = 5 Top = 6
Width = 78 Width = 78
Height = 30 Height = 30
Anchors = [akLeft] Anchors = [akLeft]
@ -252,7 +346,7 @@ object frmQryPivotBaseList: TfrmQryPivotBaseList
end end
object BTLP: TButton object BTLP: TButton
Left = 338 Left = 338
Top = 4 Top = 7
Width = 78 Width = 78
Height = 31 Height = 31
Anchors = [akLeft] Anchors = [akLeft]
@ -280,7 +374,10 @@ object frmQryPivotBaseList: TfrmQryPivotBaseList
Width = 555 Width = 555
Height = 250 Height = 250
Groups = <> Groups = <>
ShowHint = False OptionsView.ColumnFields = False
OptionsView.DataFields = False
OptionsView.FilterFields = False
OptionsView.RowFields = False
TabOrder = 4 TabOrder = 4
OnDblClick = cxDBPivotGrid1DblClick OnDblClick = cxDBPivotGrid1DblClick
end end
@ -295,12 +392,6 @@ object frmQryPivotBaseList: TfrmQryPivotBaseList
Left = 201 Left = 201
Top = 225 Top = 225
end end
object CDS_List: TClientDataSet
Aggregates = <>
Params = <>
Left = 395
Top = 280
end
object ADOQueryList: TADOQuery object ADOQueryList: TADOQuery
Connection = DataLink_schedule.ADOLink Connection = DataLink_schedule.ADOLink
LockType = ltReadOnly LockType = ltReadOnly
@ -309,7 +400,7 @@ object frmQryPivotBaseList: TfrmQryPivotBaseList
Top = 368 Top = 368
end end
object DataSource1: TDataSource object DataSource1: TDataSource
DataSet = CDS_List DataSet = ADOQueryList
Left = 768 Left = 768
Top = 296 Top = 296
end end

View File

@ -6,11 +6,29 @@ uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin,cxExportPivotGridLink, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin,cxExportPivotGridLink,
FrameDateSel10, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, FrameDateSel10, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
dxSkinsCore, dxSkinsDefaultPainters, dxSkinWXI, cxClasses, dxLayoutContainer, cxPivotDrillDownFormUnit, dxSkinsCore, dxSkinsDefaultPainters, dxSkinWXI, cxClasses, dxLayoutContainer,
cxPivotDrillDownFormUnit,
dxLayoutControl, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, dxLayoutControl, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit,
Vcl.StdCtrls, Vcl.ExtCtrls, cxCustomData, cxStyles, dxBarBuiltInMenu,U_WindowFormdesign, Vcl.StdCtrls, Vcl.ExtCtrls, cxCustomData, cxStyles, dxBarBuiltInMenu,U_WindowFormdesign,
cxCustomPivotGrid, cxPivotGrid, cxGridCustomPopupMenu, cxGridPopupMenu, math, cxCustomPivotGrid, cxPivotGrid, cxGridCustomPopupMenu, cxGridPopupMenu, math,
Data.DB, Datasnap.DBClient, Data.Win.ADODB, cxDBPivotGrid; Data.DB, Datasnap.DBClient, Data.Win.ADODB, cxDBPivotGrid,
dxLayoutControlAdapters, dxSkinBasic, dxSkinBlack, dxSkinBlue,
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkroom, dxSkinDarkSide,
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue;
type type
TfrmQryPivotBaseList = class(TForm) TfrmQryPivotBaseList = class(TForm)
@ -32,11 +50,18 @@ type
TCBNOR: TcxComboBox; TCBNOR: TcxComboBox;
ADOQueryBaseCmd: TADOQuery; ADOQueryBaseCmd: TADOQuery;
ADOQueryBaseTemp: TADOQuery; ADOQueryBaseTemp: TADOQuery;
CDS_List: TClientDataSet;
ADOQueryList: TADOQuery; ADOQueryList: TADOQuery;
DataSource1: TDataSource; DataSource1: TDataSource;
cxGridPopupMenu1: TcxGridPopupMenu; cxGridPopupMenu1: TcxGridPopupMenu;
cxDBPivotGrid1: TcxDBPivotGrid; cxDBPivotGrid1: TcxDBPivotGrid;
CheckBox_filter: TCheckBox;
CheckBox_data: TCheckBox;
CheckBox_row: TCheckBox;
CheckBox_col: TCheckBox;
dxLayoutItem1: TdxLayoutItem;
dxLayoutItem2: TdxLayoutItem;
dxLayoutItem3: TdxLayoutItem;
dxLayoutItem4: TdxLayoutItem;
procedure TprintClick(Sender: TObject); procedure TprintClick(Sender: TObject);
procedure TrefreshClick(Sender: TObject); procedure TrefreshClick(Sender: TObject);
procedure TcloseClick(Sender: TObject); procedure TcloseClick(Sender: TObject);
@ -45,6 +70,10 @@ type
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure cxDBPivotGrid1DblClick(Sender: TObject); procedure cxDBPivotGrid1DblClick(Sender: TObject);
procedure CheckBox_filterClick(Sender: TObject);
procedure CheckBox_dataClick(Sender: TObject);
procedure CheckBox_rowClick(Sender: TObject);
procedure CheckBox_colClick(Sender: TObject);
private private
fWindowDesign: TWindowFormdesign; fWindowDesign: TWindowFormdesign;
CurrentPage, RecordsNumber: Integer; CurrentPage, RecordsNumber: Integer;
@ -82,6 +111,26 @@ uses
U_RTFun, U_globalVar, U_dataLink,U_FormLayOutDesign, U_LabelPrint; U_RTFun, U_globalVar, U_dataLink,U_FormLayOutDesign, U_LabelPrint;
{$R *.dfm} {$R *.dfm}
procedure TfrmQryPivotBaseList.CheckBox_colClick(Sender: TObject);
begin
cxDBPivotGrid1.OptionsView.ColumnFields:= CheckBox_col.Checked;
end;
procedure TfrmQryPivotBaseList.CheckBox_dataClick(Sender: TObject);
begin
cxDBPivotGrid1.OptionsView.DataFields:= CheckBox_data.Checked;
end;
procedure TfrmQryPivotBaseList.CheckBox_filterClick(Sender: TObject);
begin
cxDBPivotGrid1.OptionsView.FilterFields:= CheckBox_filter.Checked;
end;
procedure TfrmQryPivotBaseList.CheckBox_rowClick(Sender: TObject);
begin
cxDBPivotGrid1.OptionsView.RowFields:= CheckBox_row.Checked;
end;
constructor TfrmQryPivotBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0); constructor TfrmQryPivotBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
@ -127,6 +176,7 @@ begin
begin begin
fWindowDesign.FormStyleInit10(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10); fWindowDesign.FormStyleInit10(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10);
end; end;
TgridLiSet.Visible:=gIsCanDesign;
if dxLayoutControl_query.Tag<>999 then if dxLayoutControl_query.Tag<>999 then
readLayOut(dxLayoutControl_query,ADOQueryBaseTemp,PWideChar( fDllFileName+'|'+self.name+'|'+dxLayoutControl_query.Name+'.ini')); readLayOut(dxLayoutControl_query,ADOQueryBaseTemp,PWideChar( fDllFileName+'|'+self.name+'|'+dxLayoutControl_query.Name+'.ini'));
fWindowDesign.fProcedureName:=fProcedureName; fWindowDesign.fProcedureName:=fProcedureName;
@ -176,15 +226,15 @@ procedure TfrmQryPivotBaseList.cxDBPivotGrid1DblClick(Sender: TObject);
var var
ACrossCell: TcxPivotGridCrossCell; ACrossCell: TcxPivotGridCrossCell;
begin begin
// with PivotGrid.HitTest do with PivotGrid.HitTest do
// begin begin
// if HitAtDataCell then if HitAtDataCell then
// begin begin
// ACrossCell := (HitObject as TcxPivotGridDataCellViewInfo).CrossCell; ACrossCell := (HitObject as TcxPivotGridDataCellViewInfo).CrossCell;
// if ACrossCell <> nil then if ACrossCell <> nil then
// cxShowDrillDownDataSource(ACrossCell); cxShowDrillDownDataSource(ACrossCell);
// end; end;
// end; end;
end; end;
procedure TfrmQryPivotBaseList.doQuery(); procedure TfrmQryPivotBaseList.doQuery();
@ -200,7 +250,7 @@ begin
try try
cxDBPivotGrid1.BeginUpdate(); cxDBPivotGrid1.BeginUpdate();
CDS_List.DisableControls; ADOQueryList.DisableControls;
with ADOQueryList do with ADOQueryList do
begin begin
close; close;
@ -226,14 +276,14 @@ begin
//cxMemo1.Text:= sql.Text ; //cxMemo1.Text:= sql.Text ;
open; open;
end; end;
SCreateCDS(ADOQueryList, CDS_List); // SCreateCDS(ADOQueryList, CDS_List);
SInitCDSData(ADOQueryList, CDS_List); //SInitCDSData(ADOQueryList, CDS_List);
if Panel_page.Visible then if Panel_page.Visible then
begin begin
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list.FieldByName('TotalCount').AsInteger / RecordsNumber)); LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(ADOQueryList.FieldByName('TotalCount').AsInteger / RecordsNumber));
end; end;
finally finally
CDS_List.EnableControls; ADOQueryList.EnableControls;
cxDBPivotGrid1.EndUpdate; cxDBPivotGrid1.EndUpdate;
end; end;
end; end;
@ -258,7 +308,7 @@ begin
mSqlWhere:=fCriteria + ' ' + mSqlWhere ; mSqlWhere:=fCriteria + ' ' + mSqlWhere ;
try try
cxDBPivotGrid1.BeginUpdate(); cxDBPivotGrid1.BeginUpdate();
CDS_List.DisableControls; ADOQueryList.DisableControls;
with ADOQueryList do with ADOQueryList do
begin begin
close; close;
@ -278,21 +328,21 @@ begin
//cxMemo1.Text:= sql.Text ; //cxMemo1.Text:= sql.Text ;
open; open;
end; end;
SCreateCDS(ADOQueryList, CDS_List); // SCreateCDS(ADOQueryList, CDS_List);
SInitCDSData(ADOQueryList, CDS_List); // SInitCDSData(ADOQueryList, CDS_List);
if Panel_page.Visible then if Panel_page.Visible then
begin begin
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list.FieldByName('TotalCount').AsInteger / RecordsNumber)); LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(ADOQueryList.FieldByName('TotalCount').AsInteger / RecordsNumber));
end; end;
finally finally
CDS_List.EnableControls; ADOQueryList.EnableControls;
cxDBPivotGrid1.EndUpdate; cxDBPivotGrid1.EndUpdate;
end; end;
end; end;
function TfrmQryPivotBaseList.GetPivotGrid: TcxCustomPivotGrid; function TfrmQryPivotBaseList.GetPivotGrid: TcxCustomPivotGrid;
begin begin
Result := nil; Result := cxDBPivotGrid1;
end; end;
end. end.