TabParseFormula

Syntax

TabParseFormulaResult TabParseFormula(TabSheetId tTabSheet, TabParseFormulaArg tArg)

Parameters

tTabSheet. Table moniker.

tArg. Operation execution parameters.

Description

The TabParseFormula operation parses a formula.

Comments

The operation gets cell ranges used in a formula. To execute the operation, in the tTabSheet field specify table moniker and in the tArg field specify formula parsing parameters. The moniker can be based on the moniker of opened object instance, the table of which is worked with, following the rules:

The operation results in the collection of cell ranges used in a formula.

Example

Below is the example of formula parsing. The request contains table moniker and formula. The response contains the collection of cell ranges used in a formula.

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">
<TabParseFormula xmlns="http://www.fsight.ru/PP.SOM.Som">
<tTabSheet xmlns="">
  <id>NCICBNIIFDNNFOAEGDEPHFDNBNHKGLGECJLLNIGNLAMBHPJJ!M!S!PELHGEOIIFDNNFOAEGPBFNFHLMDKLGEBEDKPPGMGEAJCEKLCK!1</id>
  </tTabSheet>
<tArg xmlns="">
  <formula>=Sum(A0:B2;C0:D2;D0:E2)</formula>
  <coord L="0" T="0" />
  </tArg>
  </TabParseFormula>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<TabParseFormulaResult 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">
<result xmlns="">
<it>
  <i>0</i>
<r>
  <left>0</left>
  <top>0</top>
  <width>2</width>
  <height>3</height>
  </r>
  <s>5</s>
  <e>10</e>
  </it>
<it>
  <i>0</i>
<r>
  <left>2</left>
  <top>0</top>
  <width>2</width>
  <height>3</height>
  </r>
  <s>11</s>
  <e>16</e>
  </it>
<it>
  <i>0</i>
<r>
  <left>3</left>
  <top>0</top>
  <width>2</width>
  <height>3</height>
  </r>
  <s>17</s>
  <e>22</e>
  </it>
  </result>
  </TabParseFormulaResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"TabParseFormula" :
{
"tTabSheet" :
{
"id" : "NCICBNIIFDNNFOAEGDEPHFDNBNHKGLGECJLLNIGNLAMBHPJJ!M!S!PELHGEOIIFDNNFOAEGPBFNFHLMDKLGEBEDKPPGMGEAJCEKLCK!1"
},
"tArg" :
{
"formula" : "=Sum(A0:B2;C0:D2;D0:E2)",
"coord" :
{
"@T" : "0",
"@L" : "0"
}
}
}
}

JSON response:

{
"TabParseFormulaResult" :
{
"result" :
{
"it" :
[
{
"i" : "0",
"r" :
{
"left" : "0",
"top" : "0",
"width" : "2",
"height" : "3"
},
"s" : "5",
"e" : "10"
},
{
"i" : "0",
"r" :
{
"left" : "2",
"top" : "0",
"width" : "2",
"height" : "3"
},
"s" : "11",
"e" : "16"
},
{
"i" : "0",
"r" :
{
"left" : "3",
"top" : "0",
"width" : "2",
"height" : "3"
},
"s" : "17",
"e" : "22"
}
]
}
}
}
public static TabParseFormulaResult ParseFormula(string moniker, string tFormula, TabCoord tCoord)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tPar = new TabParseFormula()
{
tArg = new TabParseFormulaArg()
{
formula = tFormula,
coord = tCoord
},
tTabSheet = new TabSheetId() { id = moniker }
};
// Parse formula
var result = somClient.TabParseFormula(tPar);
return result;
}

See also:

Table: Operations