bool AddTabTableStyle(string mon, TabTableStyle tArg)
mon. Moniker for working with formatting styles of the selected area.
tArg. Parameters for adding a style.
The AddTabTableStyle operation adds a standard style to the collection and applies it to the selected area.
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:
Regular report instance moniker!Sheets!Sheet key!TableStyles - for working with sheet styles.
Regular report instance moniker!Sheets!Sheet key!absolute address!TableStyles - for working with cell range styles. Absolute address can be specified in various formats that are allowed for cells, for example: A5, A5:D10, R5C3, C:C, 43:43.
The operation results in the logical True if a style was added and applied successfully.
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.
{
"AddTabTableStyle" :
{
"mon" : "HKJBPOFGHFLNFOAEPCMMOLCIPENIILFEJLJPJINGDHAMFJHO!M!S!PKIBJJDGGHFLNFOAELFBDMPPAAHADDJBECIFBLMKKFMCDJAFG!Sheets!1!A0:D5!TableStyles",
"tArg" :
{
"Name" : "",
"PredefinedStyle" : "ExtGreenStriped"
}
}
}
{
"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: