TabParseFormulaResult TabParseFormula(TabSheetId tTabSheet, TabParseFormulaArg tArg)
tTabSheet. Table moniker.
tArg. Operation execution parameters.
The TabParseFormula operation parses a formula.
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:
'Express report instance moniker'!Tab. Express report table (if express report has one sheet).
'Express report instance moniker'!Sheets!'Sheet key'!Tab. table of specified express report sheet (if express report has several sheets).
'Workbook instance moniker'!Tab. Workbook table (if workbook has one sheet).
'Workbook instance moniker'!Sheets!'Sheet key'!Tab. Table of specified workbook sheet (if workbook has several sheets).
'Workbook instance moniker'!CorrTab. Table with correlation matrix.
'Workbook instance moniker'!CoeffTab. Table with equation coefficients.
'Workbook instance moniker'!WeightsTab. Table with weight matrix.
'Regular report instance moniker'!Sheet key. Table of specified regular report sheet.
The operation results in the collection of cell ranges used in a formula.
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.
{
"TabParseFormula" :
{
"tTabSheet" :
{
"id" : "NCICBNIIFDNNFOAEGDEPHFDNBNHKGLGECJLLNIGNLAMBHPJJ!M!S!PELHGEOIIFDNNFOAEGPBFNFHLMDKLGEBEDKPPGMGEAJCEKLCK!1"
},
"tArg" :
{
"formula" : "=Sum(A0:B2;C0:D2;D0:E2)",
"coord" :
{
"@T" : "0",
"@L" : "0"
}
}
}
}
{
"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: