bool SetPivotEvaluatorTotalsMetaData(string mon, PvtTotals tArg)
mon. Moniker for working with totals.
tArg. Parameters of changing total calculation options.
The SetPivotEvaluatorTotalsMetaData operation changes total calculation options.
To execute the operation, in the mon field specify moniker of regular report instance with the !DataArea!DataSources!source key!DataSourceSlices!slice key!Pivot!Totals postfix to work with totals, and in the tArg field specify options to be determined.
The moniker can be obtained on executing the OpenPrxMeta operation.
The operation returns True if the settings were changed successfully.
Below is the example of enabling calculation of totals by columns. The request contains moniker for working with totals and options to be calculated. The request contains whether total calculation was enabled successfully.
{
"SetPivotEvaluatorTotalsMetaData" :
{
"mon" : "HAPIEIKAGHBPFOAEGECNPBJBABIFDABEOKMMJKOHAOBCEPLN!M!S!PLMNJPALAGHBPFOAENFAIOMEDPPLOKFNEKKJAEHOAOHCPFIIC!DataArea!DataSources!1!DataSourceSlices!1!Pivot!Totals",
"tArg" :
{
"treatEmptyAsZero" : "true",
"includeOwner" : "true",
"columnTypes" :
{
"t" : "Sum"
},
"enabled" : "true",
"columnSettings" :
{
"namingMode" : "Combined",
"totalsNameSeparator" : "-",
"hierarchyTotal" : "true",
"overallTotal" : "true",
"insteadOwnerTotalsType" : "Sum"
}
}
}
}
{
"SetPivotEvaluatorTotalsMetaDataResult" : "1"
}
public static bool SetPivotEvaluatorTotalsMetaData(string moniker, uint dataSourceKey, uint sliceKey)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetPivotEvaluatorTotalsMetaData()
{
tArg = new PvtTotals()
{
enabled = true,
columnTypes = new PvtEvaluatorElementType[1] { PvtEvaluatorElementType.Sum },
columnSettings = new PvtEvaluatorTotalsSettings()
{
hierarchyTotal = true,
insteadOwnerTotalsType = PvtEvaluatorElementType.Sum,
namingMode = PvtTotalParentNamingMode.Combined,
overallTotal = true,
totalsNameSeparator = "-"
},
includeOwner = true,
treatEmptyAsZero = true
},
mon = moniker + "!DataArea!DataSources!" + dataSourceKey.ToString() + "!DataSourceSlices!" + sliceKey.ToString() + "!Pivot!Totals"
};
// Change totals calculation settings
var result = somClient.SetPivotEvaluatorTotalsMetaData(tSet);
return result;
}
See also: