Below is the example of using the SetEaxMd operation to set up conditional formatting in express report table. The request contains moniker of opened express report instance, the pattern indicating whether styles of conditional formats must be changed, and metadata that contains two conditional formats. The first conditional format highlights maximum values, the second one highlights minimum ones. Each conditional format has its own formatting style. The operation results in the moniker of the changed express report.
{ "SetEaxMd" : { "tEax" : { "id" : "S1!M!S!E2" }, "tArg" : { "pattern" : { "obInst" : "false", "gridStyle" : { "ops" : { "it" : { "Key" : "InternalFormatConditions", "Value" : "Set" } } } }, "meta" : { "grid" : { "style" : { "internalFormatConditions" : { "Condition" : [ { "Key" : "0", "Type" : "RankValues", "Enabled" : "true", "Details" : { "RankValues" : { "Type" : "0", "Percent" : "0", "Count" : "3", "Style" : { "Font" : { "@B" : "true", "@C" : "#00FF00", "@F" : "Calibri" } }, "PercentUsed" : "false" } } }, { "Key" : "0", "Type" : "RankValues", "Enabled" : "true", "Details" : { "RankValues" : { "Type" : "1", "Percent" : "0", "Count" : "3", "Style" : { "Font" : { "@C" : "#FF0000", "@F" : "Calibri", "@I" : "true" } }, "PercentUsed" : "false" } } } ] } } } } } } }
{ "SetEaxMdResult" : { "changedDims" : "", "id" : { "id" : "S1!M!S!E2" } } }
public static SetEaxMdResult SetEaxFormatConditions(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, gridStyle = new EaxGridStylePattern() //Conditional format setup { ops = new EaxGridStylePartListOpsIT[]
{ new EaxGridStylePartListOpsIT() { Key = EaxGridStylePart.InternalFormatConditions, Value = ListOperation.Set }, } }
}, //Changeable metadata meta = new EaxMd() { grid = new EaxGrid() //Totals formatting setup {
style = new EaxGridStyle() { internalFormatConditions = new TabFormatCondition[] {
new TabFormatCondition() //Maximum value highlighting format { Type = TabConditionType.RankValues, Enabled = true, Details = new TabFormatConditionDetails() {
RankValues = new TabFormatRankValues() { Count = 3, Type = 0, //Maximum values
Style = new TabStyle() { Font = new TabFontStyle() { B = true, BSpecified = true,
C = "#00FF00", F = "Calibri", } }
} } }, new TabFormatCondition() //Minimum value highlighting format { Type = TabConditionType.RankValues,
Enabled = true, Details = new TabFormatConditionDetails() { RankValues = new TabFormatRankValues()
{ Count = 3, Type = 1, //Minimum values Style = new TabStyle() { Font = new TabFontStyle()
{ I = true, ISpecified = true, C = "#FF0000",
F = "Calibri", } } } } }
} } } }
}, tEax = moniker }; //Changing totals parameters var result = somClient.SetEaxMd(tEaxMd); return result; }
See also: