bool SetStyle(string mon, StyleMetaData tArg)
mon. Moniker containing information about the table area, which formatting should be changed.
tArg. Formatting style parameters that should be applied to table area.
The SetStyle operation changes formatting style for the specified table area displaying an analytical data area.
To execute the operation, in the mon field specify regular report instance moniker with the following postfix: !DataArea!DataSources!<data source key>!DataSourceSlices!<slice key>!Views!<table key>!EaxTableStyle!.
This moniker should also be appended with one of the following values:
Internal - to change data area formatting.
Top - to change columns header formatting.
Left - to change rows header formatting.
The moniker can be obtained on executing the OpenPrxMeta operation.
In the tArg.style field specify formatting style parameters that should be applied.
The operation returns True if, formatting is applied successfully.
Below is the example of changing table column header formatting. The request contains table area moniker and parameters of applied style. The response contains whether formatting style is successfully applied.
{
"SetStyle" :
{
"mon" : "S1!M!S!P1!DataArea!DataSources!1!DataSourceSlices!1!Views!3!EaxTableStyle!Top",
"tArg" :
{
"style" :
{
"Text" :
{
"@VA" : "1",
"@HA" : "1",
"@M" : "7px 6px 8px 6px",
"@WW" : "1"
},
"NumberFormat" :
{
"@F" : "",
"@FT" : "0"
},
"Font" :
{
"@B" : "true",
"@S" : "8",
"@F" : "Arial",
"@H" : "12"
},
"Borders" : "",
"Hyperlink" : ""
}
}
}
}
{
"SetStyleResult" : "1"
}
public static bool SetSpecificRangetyle(string moniker, ulong sourceKey, ulong sliceKey, ulong viewKey, TabStyle newStyle)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetStyle()
{
tArg = new StyleMetaData()
{
style = newStyle
},
mon = moniker + "!DataArea!DataSources!" + sourceKey.ToString() + "!DataSourceSlices!" + sliceKey.ToString() + "!Views!" + viewKey.ToString() + "!EaxTableStyle!Top"
};
//Change style
var result = somClient.SetStyle(tSet);
return result;
}
See also: