SetStyle

Syntax

bool SetStyle(string mon, StyleMetaData tArg)

Parameters

mon. Moniker containing information about cell range or table area which formatting must be changed.

tArg. Formatting style parameters that should be applied to table area.

Description

The SetStyle operation changes formatting style for the cell range or selected table range displayed analytical data area.

Comments

To execute the operation, in the mon field specify the moniker in the following format:

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.

Example

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.

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">
<SetStyle xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">S1!M!S!P1!DataArea!DataSources!1!DataSourceSlices!1!Views!3!EaxTableStyle!Top</mon>
<tArg xmlns="">
<style>
  <Text HA="1" VA="1" WW="1" M="7px 6px 8px 6px" />
  <NumberFormat FT="0" F="" />
  <Font F="Arial" S="8" B="true" H="12" />
  <Borders />
  <Hyperlink />
  </style>
  </tArg>
  </SetStyle>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SetStyleResult 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">1</SetStyleResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

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

JSON response:

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

Interactive Visual Components