UseMethodFromDataSource: Boolean;
The UseMethodFromDataSource property returns True if the method that is set for data aggregation in the source is used to calculate totals. Otherwise it returns False. This means aggregation is set directly for a fact of the cube (server aggregation). If the property returns True, totals are calculated using the method that is set in IStandardCubeFactBinding.AggregationType . If the element is not bound to a standard fact or the method is undefined, the totals are calculated based on the method that is set in IPrxDataIslandTotals.MethodValue (default value is sum).
The following example assumes that there is the Report object with the IPrxReport type. The regular report should contain a data area with the DATAISLAND identifier.
Sub UserProc;
Var
Report: IPrxReport;
DIs: IPrxDataIslands;
DI: IPrxDataIsland;
Prop: IPrxDataIslandProperties;
Totals : IPrxDataIslandTotals;
Dim : IDimInstance;
DimProp : IPrxDataIslandDimension;
Begin
DIs := Report.DataIslands ;
DI := DIs.FindById("DATAISLAND").Edit;
Prop := DI.Properties;
Dim := DI.Slice.LeftHeader.Item(0).Dimension;
DimProp := Prop.Dimension(Dim.Dimension);
Totals := DimProp.LevelTotals;
Totals.Totals := TriState.OnOption;
If DI.DataSourceTotalsDefined And Not Totals.UseMethodFromDataSource Then
Totals.MethodFromDataSource := TriState.OnOption;
End If;
DI.Save;
End Sub UserProc;
If the method that is set for aggregation in the source is not used to calculate data area totals, and the aggregation is set in the source, using aggregation method for calculation of totals is enabled.
See also: