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