SetTabFormatCondition

Syntax

bool SetTabFormatCondition(string mon, TabFormatCondition tArg)

Parameters

mon. Moniker of the range for working with its conditional formats.

tArg. Updated conditional format settings.

Description

The SetTabFormatCondition operation changes conditional format settings for cell range.

Comments

To execute the operation, in the mon field specify regular report instance moniker with the !Sheets!sheet key!range address!FormatConditions!conditional format index postfix, and in the tArg field specify conditional format parameters to be applied.

The operation results in the logical True if the settings were changed successfully.

Example

Below is the example of changing conditional format settings. The request contains conditional format moniker, new conditional format settings, and cell formatting style. The response contains whether change is executed 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">
<SetTabFormatCondition xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">S1!M!S!P1!Sheets!1!A0:B3!FormatConditions!0</mon>
<tArg xmlns="">
  <k>0</k>
  <Key>0</Key>
  <Type>CellContent</Type>
<Details>
<CellContent>
  <ContentType>0</ContentType>
  <CellValue>100</CellValue>
  <SpecificText />
<Style>
  <Font S="10" B="true" />
  </Style>
  <ValueCondition>4</ValueCondition>
  <TextCondition>0</TextCondition>
  <DateCondition>0</DateCondition>
  <MinValue />
  <MaxValue />
  </CellContent>
  </Details>
  </tArg>
  </SetTabFormatCondition>
  </s:Body>
  </s:Envelope>

SOAP response:

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

JSON request:

{
"SetTabFormatCondition" :
{
"mon" : "S1!M!S!P1!Sheets!1!A0:B3!FormatConditions!0",
"tArg" :
{
"k" : "0",
"Key" : "0",
"Type" : "CellContent",
"Details" :
{
"CellContent" :
{
"ContentType" : "0",
"CellValue" : "100",
"SpecificText" : "",
"Style" :
{
"Font" :
{
"@B" : "true",
"@S" : "10"
}
},
"ValueCondition" : "4",
"TextCondition" : "0",
"DateCondition" : "0",
"MinValue" : "",
"MaxValue" : ""
}
}
}
}
}

JSON response:

{
"SetTabFormatConditionResult" : "1"
}
public static bool SetFormatCondition(string moniker, string sheetKey, string address, string formatKey, string cellValue, TabStyle formatStyle)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tTab = new SetTabFormatCondition()
{
mon = moniker + "!Sheets!" + sheetKey + '!' + address + "!FormatConditions!" + formatKey,
tArg = new TabFormatCondition()
{
Type = TabConditionType.CellContent,
Details = new TabFormatConditionDetails()
{
CellContent = new TabFormatCellContent()
{
ContentType = 0, //TabFormatContentType.CellValue
ValueCondition = 4, //TabConditionCellContentValue.Above
CellValue = cellValue,
Style = formatStyle,
SpecificText = "",
MinValue = "",
MaxValue = ""
}
}
}
};
// Change conditional format parameters
var result = somClient.SetTabFormatCondition(tTab);
return result;
}

See also:

Table