SetPivotEvaluatorTotalsMetaData

Syntax

bool SetPivotEvaluatorTotalsMetaData(string mon, PvtTotals tArg)

Parameters

mon. Moniker for working with totals.

tArg. Parameters of changing total calculation options.

Description

The SetPivotEvaluatorTotalsMetaData operation changes total calculation options.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetPivotEvaluatorTotalsMetaData xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">HAPIEIKAGHBPFOAEGECNPBJBABIFDABEOKMMJKOHAOBCEPLN!M!S!PLMNJPALAGHBPFOAENFAIOMEDPPLOKFNEKKJAEHOAOHCPFIIC!DataArea!DataSources!1!DataSourceSlices!1!Pivot!Totals</mon>
<tArg xmlns="">
  <treatEmptyAsZero>true</treatEmptyAsZero>
  <includeOwner>true</includeOwner>
<columnTypes>
  <t>Sum</t>
  </columnTypes>
  <enabled>true</enabled>
<columnSettings>
  <namingMode>Combined</namingMode>
  <totalsNameSeparator>-</totalsNameSeparator>
  <hierarchyTotal>true</hierarchyTotal>
  <overallTotal>true</overallTotal>
  <insteadOwnerTotalsType>Sum</insteadOwnerTotalsType>
  </columnSettings>
  </tArg>
  </SetPivotEvaluatorTotalsMetaData>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SetPivotEvaluatorTotalsMetaDataResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</SetPivotEvaluatorTotalsMetaDataResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"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"
}
}
}
}

JSON response:

{
"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:

Working with Regular Reports