StyleMetaData GetStyle(string mon)
mon. Moniker containing information about the table area, which formatting should be obtained.
The GetStyle operation gets formatting style for the cell range or selected table range displayed analytical data area.
To execute the operation, in the mon field specify the moniker in the following format:
To work with the cell range: «Regular report instance moniker!Sheets!<Sheet key>!<absolute address>!Style». Absolute address can be specified in various formats that are allowed for cells, for example: A5, A5:D10, R5C3, C:C, 43:43.
To work with the specified table area: «Regular report instance moniker!DataArea!DataSources!<source key>!DataSourceSlices!<slice key>!Views!<table key>!EaxTableStyle!».
This moniker should also be appended with one of the following values:
Internal - to get data area formatting.
Top - to get column headers formatting.
Left - to get row headers formatting.
The moniker can be obtained on executing the OpenPrxMeta operation. The operation returns formatting of the specified table area.
To work with formatting style specified for control block, the moniker can be obtained in the meta.calcObjet.validBlock.style field after executing the GetAlg operation.
Below is the example of getting formatting of table row headers. The request contains table area moniker. The response contains the obtained formatting.
{
"GetStyle" :
{
"mon" : "S1!M!S!P1!DataArea!DataSources!1!DataSourceSlices!1!Views!3!EaxTableStyle!Left"
}
}
{
"GetStyleResult" :
{
"style" :
{
"Text" :
{
"@VA" : "1",
"@HA" : "1",
"@M" : "7px 6px 8px 6px",
"@WW" : "1"
},
"NumberFormat" :
{
"@F" : "",
"@FT" : "0"
},
"Font" :
{
"@B" : "false",
"@S" : "8",
"@F" : "Arial",
"@H" : "12"
},
"Borders" : "",
"Hyperlink" : ""
}
}
}
public static StyleMetaData GetSpecificRangeStyle(string moniker, uint sourceKey, uint sliceKey, uint viewKey)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetStyle()
{
//mon = moniker + "!DataArea!DataSources!" + sourceKey.ToString() + "!DataSourceSlices!" + sliceKey.ToString() + "!Views!" + viewKey.ToString() + "!EaxTableStyle!Left"
mon = moniker + "!DataArea!Views!" + viewKey.ToString() + "!EaxTableStyle!Left"
};
//Get style
var result = somClient.GetStyle(tGet);
return result;
}
See also: