if DataSetTSSJJ1=nil then
DataSetTSSJJ1 := TPivotDataSet.Create(Self);
DataSetTSSJJ1.Close;
DataSetTSSJJ1.DecisionDef.DimensionDefs.Clear;
DataSetTSSJJ1.DecisionDef.SummaryDefs.Clear;
with DataSetTSSJJ1.DecisionDef.DimensionDefs.Add do
begin
TableName := 'SJJ_WZKCB';
FieldType := TFieldType.ftString;
FieldName := 'KF';
Origin := 'KF';
DisplayName := '库房';
IsPrimaryKey := True;
IsAgg := False;
DimStyleDefType := TDecisionDimStyleDefType.dfRowDim;
DimType := TDecisionDimType.dtDataDim;
ShowSubTotal := False;
CustomDim.FieldType := TCustomDimType.cdtString;
BinType := TBinType.binNone;
end;
with DataSetTSSJJ1.DecisionDef.DimensionDefs.Add do
begin
TableName := 'SJJ_WZKCB';
FieldType := TFieldType.ftString;
FieldName := 'WPBM';
Origin := 'WPBM';
DisplayName := '产品';
IsPrimaryKey := True;
IsAgg := False;
ShowSubTotal := False;
CustomDim.FieldType := TCustomDimType.cdtString;
BinType := TBinType.binNone;
DimStyleDefType := TDecisionDimStyleDefType.dfColDim;
DimType := TDecisionDimType.dtDataDim;
end;
with DataSetTSSJJ1.DecisionDef.SummaryDefs.Add do
begin
TableName := 'SJJ_WZKCB';
FieldType := TFieldType.ftInteger;
FieldName := 'ZDKCL';
Origin := 'ZDKCL';
DisplayName := '数量';
IsPrimaryKey := False;
IsAgg := False;
SummType := TDecisionSummType.dtDataSumm;
SummFlags := TSummFlags.sfSum;
end;
with DataSetTSSJJ1 do
begin
ShowProgressDialog := True;
ID := 'TSSJB11';
DisplayName := '测试透视数据集';
Name := 'TSSJB11';
DataSetTSSJJ1.Database.URL := 'Biz:\JUSTEPDEMOSYSTEM\JUSTEPDEMODATABASE.DATABASE';