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 getting pattern. The response contains the requested settings.
{
"GetWbkMd" :
{
"tWbk" :
{
"id" : "S1!M!S!W9"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"useGridAutoAdjust" : "true",
"attrsTreeOptions" : "Get"
}
}
}
}
{
"GetWbkMdResult" :
{
"id" :
{
"id" : "S1!M!S!W9"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "1",
"@hf" : "0",
"i" : "WBK_STYLE",
"n" : "Forecast",
"k" : "5646",
"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" : "5",
"its" : ""
},
"attrsTreeOptions" :
{
"its" :
{
"it" :
[
{
"k" : "5654",
"id" : "TS_DB_STAT",
"n" : "Statistics data",
"vis" : "1",
"rubricator" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "TS_DB_STAT",
"n" : "Statistics data",
"k" : "5654",
"c" : "2822",
"p" : "5471",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "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> "
},
{
"k" : "5472",
"id" : "TS_DB",
"n" : "Time series database",
"vis" : "1",
"rubricator" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "4",
"@hf" : "0",
"i" : "TS_DB",
"n" : "Time series database",
"k" : "5472",
"c" : "2822",
"p" : "5471",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "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> "
}
]
},
"vis" : "1"
}
}
}
}
public static GetWbkMdResult GetWbkAttTreeOpt(WbkId wbk)
{// Set operation execution parameters
var tOp = new GetWbkMd
{
tWbk = wbk,
tArg = new GetWbkMdArg
{// Set pattern for getting data
pattern = new WbkMdPattern
{
attrsTreeOptions = ListOperation.Get
}
}
};
// Create proxy object for operation execution
var somClient = new SomPortTypeClient();
// Execute operation
var gRes = somClient.GetWbkMd(tOp);
// Display series tree settings in the console window
WbkAttrsTreeOptions opt = gRes.meta.attrsTreeOptions;
foreach (WbkAttrsTreeOption it in opt.its)
{
Console.WriteLine("Settings for data source '"+it.rubricator.n+"':");
Console.WriteLine("".PadRight(3) + it.hierAttrs);
};
return gRes;
}
See also: