AddTabTableStyle

Syntax

bool AddTabTableStyle(string mon, TabTableStyle tArg)

Parameters

mon. Moniker for working with formatting styles of the selected area.

tArg. Parameters for adding a style.

Description

The AddTabTableStyle operation adds a standard style to the collection and applies it to the selected area.

Comments

To execute the operation, in the mon field specify moniker for working with styles, and in the tArg field specify parameters for adding a style. The moniker is specified in one of the following formats:

The operation results in the logical True if a style was added and applied successfully.

Example

Below is the example of adding and applying a standard style for a cell range. The request contains moniker for working with styles of a specific cell range and the style to be added. The response contains whether the style was added successfully.

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">
<AddTabTableStyle xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">HKJBPOFGHFLNFOAEPCMMOLCIPENIILFEJLJPJINGDHAMFJHO!M!S!PKIBJJDGGHFLNFOAELFBDMPPAAHADDJBECIFBLMKKFMCDJAFG!Sheets!1!A0:D5!TableStyles</mon>
<tArg xmlns="">
  <Name />
  <PredefinedStyle>ExtGreenStriped</PredefinedStyle>
  </tArg>
  </AddTabTableStyle>
  </s:Body>
  </s:Envelope>

SOAP response:

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

JSON request:

{
"AddTabTableStyle" :
{
"mon" : "HKJBPOFGHFLNFOAEPCMMOLCIPENIILFEJLJPJINGDHAMFJHO!M!S!PKIBJJDGGHFLNFOAELFBDMPPAAHADDJBECIFBLMKKFMCDJAFG!Sheets!1!A0:D5!TableStyles",
"tArg" :
{
"Name" : "",
"PredefinedStyle" : "ExtGreenStriped"
}
}
}

JSON response:

{
"AddTabTableStyleResult" : "1"
}
public static bool AddTabTableStyle(string moniker, string sheetKey, string address)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tAdd = new AddTabTableStyle()
{
mon = moniker + "!Sheets!" + sheetKey + '!' + address + "!TableStyles",
tArg = new TabTableStyle()
{
Name = string.Empty,
PredefinedStyle = TabTablePredefinedStyle.ExtGreenStriped
}
};
// Add predefined style
var result = somClient.AddTabTableStyle(tAdd);
return result;
}

See also:

Table: Operations