Below is the example of using the GetWbkMd operation to get values for workbook series. The request contains an instance of opened workbook and patterns for extracting workbook data. The response contains requested data.
{ "GetWbkMd" : { "tWbk" : { "id" : "S1!M!S!W6"
}, "tArg" : { "pattern" : { "obInst" : "true", "observationsTable" : { "cells" : "true", "emptyCells" : "false",
"getCellDate" : "false", "attributes" : { "it" : { "k" : "4294967295", "id" : "DL" } }, "getCellText" : "true"
}, "cellsTable" : { "cells" : "true", "emptyCells" : "false", "getCellDate" : "true" } } } } }
{ "GetWbkMdResult" : { "id" : { "id" : "S1!M!S!W6"
}, "meta" : { "obInst" : { "obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "WBK_OBS",
"n" : "Mixed data", "k" : "5624", "c" : "2827", "p" : "5471", "h" : "0" } }, "dirty" : "1", "windowsPosition" : "Vertical", "hasPivot" : "0",
"hasLaner" : "1", "series" : { "@count" : "3", "its" : "" }, "observationsTable" : { "@rowCount" : "3", "@columnCount" : "54",
"cells" : { "c" : [ { "@text" : "Yearly", "@v" : "1", "@dt" : "2", "@row" : "0", "@att" : "0",
"@column" : "0" }, { "@text" : "Yearly", "@v" : "1", "@dt" : "2", "@row" : "0", "@att" : "0", "@column" : "17" }
{ "@text" : "Yearly", "@v" : "1", "@dt" : "2", "@row" : "0", "@att" : "0", "@column" : "34" }, { "@text" : "Yearly"
"@v" : "1", "@dt" : "2", "@row" : "0", "@att" : "0", "@column" : "51" }, { "@text" : "Quartely", "@v" : "3", "@dt" : "2"
"@row" : "1", "@att" : "0", "@column" : "1" }, { "@text" : "Quarterly", "@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0"
"@column" : "5" }, { "@text" : "Quarterly", "@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0", "@column" : "9" }
{ "@text" : "Quarterly", "@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0", "@column" : "13" }, { "@text" : "Quarterly"
"@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0", "@column" : "18" }, { "@text" : "Quarterly", "@v" : "3", "@dt" : "2"
"@row" : "1", "@att" : "0", "@column" : "22" }, { "@text" : "Quarterly", "@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0"
"@column" : "26" }, { "@text" : "Quarterly", "@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0", "@column" : "30" }
{ "@text" : "Quarterly", "@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0", "@column" : "35" }, { "@text" : "Quarterly"
"@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0", "@column" : "39" }, { "@text" : "Quarterly", "@v" : "3", "@dt" : "2"
"@row" : "1", "@att" : "0", "@column" : "43" }, { "@text" : "Quarterly", "@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0"
"@column" : "47" }, { "@text" : "Quarterly", "@v" : "3", "@dt" : "2", "@row" : "1", "@att" : "0", "@column" : "52" }
{ "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "2" }, { "@text" : "Monthly"
"@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "3" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2"
"@row" : "2", "@att" : "0", "@column" : "4" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0"
"@column" : "6" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "7" }
{ "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "8" }, { "@text" : "Monthly"
"@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "10" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2"
"@row" : "2", "@att" : "0", "@column" : "11" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0"
"@column" : "12" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "14" }
{ "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "15" }, { "@text" : "Monthly"
"@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "16" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2"
"@row" : "2", "@att" : "0", "@column" : "19" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0"
"@column" : "20" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "21" }
{ "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "23" }, { "@text" : "Monthly"
"@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "24" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2"
"@row" : "2", "@att" : "0", "@column" : "25" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0"
"@column" : "27" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "28" }
{ "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "29" }, { "@text" : "Monthly"
"@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "31" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2"
"@row" : "2", "@att" : "0", "@column" : "32" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0"
"@column" : "33" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "36" }
{ "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "37" }, { "@text" : "Monthly"
"@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "38" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2"
"@row" : "2", "@att" : "0", "@column" : "40" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0"
"@column" : "41" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "42" }
{ "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "44" }, { "@text" : "Monthly"
"@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "45" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2"
"@row" : "2", "@att" : "0", "@column" : "46" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0"
"@column" : "48" }, { "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "49" }
{ "@text" : "Monthly", "@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "50" }, { "@text" : "Monthly"
"@v" : "4", "@dt" : "2", "@row" : "2", "@att" : "0", "@column" : "53" } ] } }, "cellsTable" :
{ "@rowCount" : "3", "@columnCount" : "54", "cells" : { "c" : [ { "@v" : "11.277725", "@dt" : "3",
"@row" : "0", "@column" : "0", "@date" : "2000-01-01" }, { "@v" : "11.653670", "@dt" : "3", "@row" : "0", "@column" : "17", "@date" : "2001-01-01"
}, { "@v" : "11.723559", "@dt" : "3", "@row" : "0", "@column" : "34", "@date" : "2002-01-01" }, { "@v" : "11.607034",
"@dt" : "3", "@row" : "0", "@column" : "51", "@date" : "2003-01-01" }, { "@v" : "2.819431", "@dt" : "3", "@row" : "1", "@column" : "1",
"@date" : "2000-01-01" }, { "@v" : "2.819431", "@dt" : "3", "@row" : "1", "@column" : "5", "@date" : "2000-04-01" }, {
"@v" : "2.819431", "@dt" : "3", "@row" : "1", "@column" : "9", "@date" : "2000-07-01" }, { "@v" : "2.819431", "@dt" : "3", "@row" : "1",
"@column" : "13", "@date" : "2000-10-01" }, { "@v" : "2.913417", "@dt" : "3", "@row" : "1", "@column" : "18", "@date" : "2001-01-01" },
{ "@v" : "2.913417", "@dt" : "3", "@row" : "1", "@column" : "22", "@date" : "2001-04-01" }, { "@v" : "2.913417", "@dt" : "3",
"@row" : "1", "@column" : "26", "@date" : "2001-07-01" }, { "@v" : "2.913417", "@dt" : "3", "@row" : "1", "@column" : "30", "@date" : "2001-10-01"
}, { "@v" : "2.930890", "@dt" : "3", "@row" : "1", "@column" : "35", "@date" : "2002-01-01" }, { "@v" : "2.930890",
"@dt" : "3", "@row" : "1", "@column" : "39", "@date" : "2002-04-01" }, { "@v" : "2.930890", "@dt" : "3", "@row" : "1", "@column" : "43",
"@date" : "2002-07-01" }, { "@v" : "2.930890", "@dt" : "3", "@row" : "1", "@column" : "47", "@date" : "2002-10-01" }, {
"@v" : "2.901759", "@dt" : "3", "@row" : "1", "@column" : "52", "@date" : "2003-01-01" }, { "@v" : "0.939810", "@dt" : "3", "@row" : "2",
"@column" : "2", "@date" : "2000-01-01" }, { "@v" : "0.939810", "@dt" : "3", "@row" : "2", "@column" : "3", "@date" : "2000-02-01" },
{ "@v" : "0.939810", "@dt" : "3", "@row" : "2", "@column" : "4", "@date" : "2000-03-01" }, { "@v" : "0.939810", "@dt" : "3",
"@row" : "2", "@column" : "6", "@date" : "2000-04-01" }, { "@v" : "0.939810", "@dt" : "3", "@row" : "2", "@column" : "7", "@date" : "2000-05-01"
}, { "@v" : "0.939810", "@dt" : "3", "@row" : "2", "@column" : "8", "@date" : "2000-06-01" }, { "@v" : "0.939810",
"@dt" : "3", "@row" : "2", "@column" : "10", "@date" : "2000-07-01" }, { "@v" : "0.939810", "@dt" : "3", "@row" : "2", "@column" : "11",
"@date" : "2000-08-01" }, { "@v" : "0.939810", "@dt" : "3", "@row" : "2", "@column" : "12", "@date" : "2000-09-01" }, {
"@v" : "0.939810", "@dt" : "3", "@row" : "2", "@column" : "14", "@date" : "2000-10-01" }, { "@v" : "0.939810", "@dt" : "3", "@row" : "2",
"@column" : "15", "@date" : "2000-11-01" }, { "@v" : "0.939810", "@dt" : "3", "@row" : "2", "@column" : "16", "@date" : "2000-12-01" },
{ "@v" : "0.971139", "@dt" : "3", "@row" : "2", "@column" : "19", "@date" : "2001-01-01" }, { "@v" : "0.971139", "@dt" : "3",
"@row" : "2", "@column" : "20", "@date" : "2001-02-01" }, { "@v" : "0.971139", "@dt" : "3", "@row" : "2", "@column" : "21", "@date" : "2001-03-01"
}, { "@v" : "0.971139", "@dt" : "3", "@row" : "2", "@column" : "23", "@date" : "2001-04-01" }, { "@v" : "0.971139",
"@dt" : "3", "@row" : "2", "@column" : "24", "@date" : "2001-05-01" }, { "@v" : "0.971139", "@dt" : "3", "@row" : "2", "@column" : "25",
"@date" : "2001-06-01" }, { "@v" : "0.971139", "@dt" : "3", "@row" : "2", "@column" : "27", "@date" : "2001-07-01" }, {
"@v" : "0.971139", "@dt" : "3", "@row" : "2", "@column" : "28", "@date" : "2001-08-01" }, { "@v" : "0.971139", "@dt" : "3", "@row" : "2",
"@column" : "29", "@date" : "2001-09-01" }, { "@v" : "0.971139", "@dt" : "3", "@row" : "2", "@column" : "31", "@date" : "2001-10-01" },
{ "@v" : "0.971139", "@dt" : "3", "@row" : "2", "@column" : "32", "@date" : "2001-11-01" }, { "@v" : "0.971139", "@dt" : "3",
"@row" : "2", "@column" : "33", "@date" : "2001-12-01" }, { "@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "36", "@date" : "2002-01-01"
}, { "@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "37", "@date" : "2002-02-01" }, { "@v" : "0.976963",
"@dt" : "3", "@row" : "2", "@column" : "38", "@date" : "2002-03-01" }, { "@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "40",
"@date" : "2002-04-01" }, { "@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "41", "@date" : "2002-05-01" }, {
"@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "42", "@date" : "2002-06-01" }, { "@v" : "0.976963", "@dt" : "3", "@row" : "2",
"@column" : "44", "@date" : "2002-07-01" }, { "@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "45", "@date" : "2002-08-01" },
{ "@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "46", "@date" : "2002-09-01" }, { "@v" : "0.976963", "@dt" : "3",
"@row" : "2", "@column" : "48", "@date" : "2002-10-01" }, { "@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "49", "@date" : "2002-11-01"
}, { "@v" : "0.976963", "@dt" : "3", "@row" : "2", "@column" : "50", "@date" : "2002-12-01" }, { "@v" : "0.967253",
"@dt" : "3", "@row" : "2", "@column" : "53", "@date" : "2003-01-01" } ] } } } } }
The GetWbkObsTbl function gets data of workbook series. Input parameters:
wbk. Workbook instance.
After execution the function returns a result of data extraction. The console window displays series values.
public static GetWbkMdResult GetWbkObsTbl(WbkId wbk) {// Set operation execution parameters var tOp = new GetWbkMd {
tWbk = wbk, tArg = new GetWbkMdArg {// Set data extraction pattern pattern = new WbkMdPattern { observationsTable = new WbkObservationsTablePattern() { getCellDate = false, getCellText = true, attributes = new ItKey[]
{ new ItKey() { id = "DL", k = uint.MaxValue } }, cells = true, emptyCells = false, },
cellsTable = new WbkCellsTablePattern() { getCellDate = true, cells = true, emptyCells = false } } } }; // Create proxy object for operation execution
var somClient = new SomPortTypeClient(); // Execute operation var gRes = somClient.GetWbkMd(tOp); // Output data table values into window ulong row = 10; WbkCellsTable tbl = gRes.meta.cellsTable; WbkObservationsTable obsTbl = gRes.meta.observationsTable; foreach (PvtTableCell cell in tbl.cells) { if (row != cell.row)
{ row = cell.row; Console.WriteLine("---------ROW " + (row+1) + "---------"); PvtTableCell c = obsTbl.cells.Single(it => it.row == cell.row && it.column == cell.column); Console.WriteLine("frequency: " + c.text); Console.WriteLine("values:"); }; Console.Write(cell.date.ToShortDateString() + ": "); Console.WriteLine(cell.v); }; return gRes; }
See also: