Below is the example of using the GetWbkMd operation to get whether the calculation results for workbook series are available. The request contains an instance of opened workbook and a pattern for getting data. The response returns whether calculation results are available.
{
"GetWbkMd" :
{
"tWbk" :
{
"id" : "S1!M!S!W7"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"useGridAutoAdjust" : "true",
"results" :
{
"correlation" : "true",
"coefficients" : "true",
"weights" : "true",
"tabSheet" : "false"
}
}
}
}
}
{
"GetWbkMdResult" :
{
"id" :
{
"id" : "S1!M!S!W7"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "2",
"@hf" : "0",
"i" : "WBK_CALC",
"n" : "Calculated series",
"k" : "5541",
"c" : "2827",
"p" : "5471",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "1",
"windowsPosition" : "Vertical",
"hasPivot" : "0",
"hasLaner" : "1",
"series" :
{
"@count" : "4",
"its" : ""
},
"results" :
{
"its" :
{
"it" :
[
{
"k" : "2",
"id" : "OBJ2",
"n" : "USA|A",
"vis" : "1",
"correlation" : "0",
"coefficients" : "0",
"weights" : "0"
},
{
"k" : "13",
"id" : "OBJ13",
"n" : "Geometric trend(France|A)",
"vis" : "1",
"correlation" : "0",
"coefficients" : "1",
"weights" : "0"
}
]
}
}
}
}
}
public static GetWbkMdResult GetWbkResults(WbkId wbk)
{// Set operation execution parameters
var tOp = new GetWbkMd
{
tWbk = wbk,
tArg = new GetWbkMdArg
{// Set pattern for getting data
pattern = new WbkMdPattern
{
results = new LnResultsPattern()
{
coefficients = true,
correlation = true,
weights = true,
tabSheet = false,
series = null
}
}
}
};
// Create proxy object for operation execution
var somClient = new SomPortTypeClient();
// Execute operation
var gRes = somClient.GetWbkMd(tOp);
LnResults res = gRes.meta.results;
foreach (LnResult it in res.its)
{
Console.WriteLine("Row: " + it.n);
Console.WriteLine("".PadRight(3) + "- coefficients available: " + it.coefficients);
Console.WriteLine("".PadRight(3) + "- correlation matrix available: " + it.correlation);
Console.WriteLine("".PadRight(3) + "- weights available: " + it.weights);
Console.WriteLine("");
}
return gRes;
}
See also: