Below is the example of using the GetWbkMd operation to get settings for the workbook series tree. The request contains an instance of opened workbook and data extraction pattern. The response contains the requested settings.
{ "GetWbkMd" : { "tWbk" : { "id" : "S1!M!S!W7"
}, "tArg" : { "pattern" : { "obInst" : "true", "attrsTreeOptions" : "Get" } } } }
{ "GetWbkMdResult" : { "id" : { "id" : "S1!M!S!W7" }, "meta" : { "obInst" : {
"obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "WBK_STYLE", "n" : "Forecast", "k" : "5646", "c" : "2827", "p" : "5471", "h" : "0"
} }, "dirty" : "1", "windowsPosition" : "Vertical", "hasPivot" : "0", "hasLaner" : "1", "series" : { "@count" : "5", "its" : ""
}, "attrsTreeOptions" : { "k" : "4294967295", "vis" : "1", "its" : { "it" : [ {
"k" : "5654", "id" : "TS_DB_STAT", "n" : "Statistics data", "vis" : "1", "rubricator" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "TS_DB_STAT", "n" : "Statistics data"
"k" : "5654", "c" : "2822", "p" : "5471", "h" : "0" }, "hierAttrs" : "<Breadcrumb><ITEMS VER="1"><ITEM Version="2" NAME="Country (Selected: 5)" HASLEAF="FALSE" DATA="9" PERMANENT="FALSE" HINT="" USERDATA="0:" NAMINGS="" SORTTYPE="0" SORTATTRIBUTE="" SORTDIRECTION="0"><EXVAL ISARRAY="TRUE"><ITEM VALUE="3:36"\/><ITEM VALUE="3:37"\/><ITEM VALUE="3:38"\/><ITEM VALUE="3:393"\/><ITEM VALUE="3:394"\/><\/EXVAL><\/ITEM><\/ITEMS><\/Breadcrumb>A;" }, { "k" : "5472", "id" : "TS_DB"
"n" : "Time series database", "vis" : "1", "rubricator" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "TS_DB", "n" : "Time series database", "k" : "5472", "c" : "2822"
"p" : "5471", "h" : "0" }, "hierAttrs" : "<Breadcrumb><ITEMS VER="1"><ITEM Version="2" NAME="Country" HASLEAF="FALSE" DATA="9" PERMANENT="FALSE" HINT="" USERDATA="0:" NAMINGS="" SORTTYPE="0" SORTATTRIBUTE="" SORTDIRECTION="0"\/><\/ITEMS><\/Breadcrumb>A;" } ] } } } } }
The GetWbkAttTreeOpt function gets settings for the workbook series tree. Input parameters:
wbk. Workbook instance.
After execution the function returns a result of data extraction. The console window displays information about settings for the workbook series tree.
public static GetWbkMdResult GetWbkAttTreeOpt(WbkId wbk) {// Set operation execution parameters var tOp = new GetWbkMd { tWbk = wbk, tArg = new GetWbkMdArg {// Set data extraction pattern pattern = new WbkMdPattern { attrsTreeOptions = ListOperation.Get } } }; // Create proxy object for operation execution var somClient = new SomPortTypeClient(); // Execute operation var gRes = somClient.GetWbkMd(tOp); // Output series tree settings to console window WbkAttrsTreeOptions opt = gRes.meta.attrsTreeOptions; foreach (WbkAttrsTreeOption it in opt.its) { Console.WriteLine("Data source settings'"+it.rubricator.n+"':"); Console.WriteLine("".PadRight(3) + it.hierAttrs); }; return gRes; }
See also: