Setting Up Totals

Below is the example of using the SetEaxMd operation to set up totals. The request contains moniker of opened express report instance, a pattern indicating whether totals must be set up, and metadata containing totals parameters, and total data formatting style. The operation results in the moniker of the changed express report.

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">
<SetEaxMd xmlns="http://www.fsight.ru/PP.SOM.Som">
<tEax xmlns=" ">
  <id>S12!M!S!E1</id>
  </tEax>
<tArg xmlns=" ">
<pattern>
  <obInst>false</obInst>
  <totals>true</totals>
<gridStyle>
<parts>
  <it>Totals</it>
  </parts>
  </gridStyle>
  </pattern>
<meta>
<pivot>
<evaluator>
<totals>
  <byHierarchy>true</byHierarchy>
  <byLevels>false</byLevels>
<rowTypes>
  <t>Sum</t>
  </rowTypes>
  <enabled>true</enabled>
  </totals>
  </evaluator>
  </pivot>
<grid>
<style>
<totals>
  <Font F="Calibri" C="#FF0000" I="true" B="true" />
  </totals>
  </style>
  </grid>
  </meta>
  </tArg>
  </SetEaxMd>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetEaxMdResult 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">
<id xmlns=" ">
  <id>S12!M!S!E1</id>
  </id>
  </SetEaxMdResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
 "SetEaxMd" : 
  {
   "tEax" : 
    {
     "id" : "S1!M!S!E2"
    },
   "tArg" : 
    {
     "pattern" : 
      {
       "obInst" : "false",
       "totals" : "true",
       "gridStyle" : 
        {
         "parts" : 
          {
           "it" : "Totals"
          }
        }
      },
     "meta" : 
      {
       "pivot" : 
        {
         "evaluator" : 
          {
           "totals" : 
            {
             "byHierarchy" : "true",
             "byLevels" : "false",
             "rowTypes" : 
              {
               "t" : "Sum"
              },
             "enabled" : "true"
            }
          }
        },
       "grid" : 
        {
         "style" : 
          {
           "totals" : 
            {
             "Font" : 
              {
               "@B" : "true",
               "@C" : "#FF0000",
               "@F" : "Calibri",
               "@I" : "true"
              }
            }
          }
        }
      }
    }
  }
}

JSON response:

{
 "SetEaxMdResult" : 
  {
   "changedDims" : "",
   "id" : 
    {
     "id" : "S1!M!S!E2"
    }
  }
}
    public static SetEaxMdResult SetEaxTotals(EaxId moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tEaxMd = new SetEaxMd()
{
tArg = new SetEaxMdArg()
{
pattern = new EaxMdPattern() //Pattern that will be used to change metadata
{
obInst = false,
totals = true, //Change parameters of calculated totals
gridStyle = new EaxGridStylePattern() //Change totals formatting style
{
parts = new EaxGridStylePart[]
{
EaxGridStylePart.Totals
}
},
},
//Changed metadata
meta = new EaxMd()
{
pivot = new EaxPivot()
{
evaluator = new PvtEvaluator()
{
totals = new PvtTotals() //Totals calculated in table
{
byHierarchy = true,
byLevels = false,
rowTypes = new PvtEvaluatorElementType[]
{
PvtEvaluatorElementType.Sum
},
enabled = true
}
}
},
grid = new EaxGrid()
{
style = new EaxGridStyle() //Table styles
{
totals = new TabStyle() //Totals formatting style
{
Font = new TabFontStyle()
{
B = true,
BSpecified = true,
I = true,
ISpecified = true,
C = "#FF0000",
F = "Calibri",
}
}
}
}
}
},
tEax = moniker
};
//Change totals parameters
var result = somClient.SetEaxMd(tEaxMd);
return result;
}

See also:

SetEaxMd: Operation