Ниже приведен пример использования операции OpenEax для открытия экспресс-отчета на редактирование. В запросе передается моникёр объекта, являющегося экспресс-отчетом, и шаблон, в соответствии с которым будут извлекаться метаданные. Отчет открывается на редактирование. В ответе приходит моникёр открытого экземпляра экспресс-отчета и указанные метаданные.
В примере C# используется функция FindObjectById, код которой приведен в примере «Получение описания объекта по его идентификатору».
{ "OpenEax" : { "tObject" :
{ "id" : "S1!M!189" }, "tArg" : { "args" : { "openForEdit" : "true", "storeObject" : "true" },
"metaGet" : { "obInst" : "true", "gridStyle" : { "all" : "true" } } } } }
{ "OpenEaxResult" : { "id" : { "id" : "S1!M!S!E3" }, "meta" : { "obInst" :
{ "obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "EXPRESS_1", "n" : "Экспресс-отчет", "k" : "189", "c" : "2561", "p" : "182",
"h" : "0" } }, "dirty" : "0", "grid" : { "style" : { "fixedCorner" : {
"Text" : { "@VA" : "1", "@HA" : "-1", "@M" : "7.56 5.67 7.56 5.67", "@WW" : "1" }, "NumberFormat" : { "@F" : "",
"@FT" : "0" }, "Font" : { "@A" : "0", "@B" : "true", "@S" : "9", "@C" : "#000000", "@F" : "Calibri" },
"Borders" : "", "Hyperlink" : "" }, "topHeader" : { "Text" : { "@VA" : "1", "@HA" : "2", "@M" : "7.56 5.67 7.56 5.67",
"@WW" : "1" }, "NumberFormat" : { "@F" : "", "@FT" : "0" }, "Font" : { "@A" : "0",
"@B" : "true", "@S" : "9", "@C" : "#000000", "@F" : "Calibri" }, "Borders" : "", "Hyperlink" : "" }, "leftHeader" : {
"Text" : { "@VA" : "1", "@HA" : "1", "@M" : "7.56 5.67 7.56 5.67", "@WW" : "1" }, "NumberFormat" : { "@F" : "",
"@FT" : "0" }, "Font" : { "@A" : "0", "@B" : "true", "@S" : "9", "@C" : "#000000", "@F" : "Calibri" },
"Borders" : "", "Hyperlink" : "" }, "internals" : { "Text" : { "@VA" : "1", "@HA" : "0", "@M" : "7.56 5.67 7.56 5.67",
"@WW" : "1" }, "NumberFormat" : { "@F" : "#,##0.00", "@FT" : "1" }, "Font" : { "@A" : "0",
"@S" : "9", "@C" : "#000000", "@F" : "Calibri" }, "Borders" : "", "Hyperlink" : "" }, "ABC" : { "Text" :
{ "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Fill" : { "@C" : "#CCFFCC" },
"Font" : { "@A" : "0", "@S" : "8", "@C" : "#000000", "@F" : "Arial" }, "Borders" : "", "Hyperlink" : "" },
"ABCHeader" : { "Text" : { "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Font" :
{ "@A" : "0", "@B" : "true", "@S" : "8", "@C" : "#000000", "@F" : "Arial" }, "Borders" : "", "Hyperlink" : "" },
"highlightedCells" : { "Text" : { "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Font" :
{ "@A" : "0", "@B" : "true", "@S" : "8", "@C" : "#FF0000", "@F" : "Arial" }, "Borders" : "", "Hyperlink" : "" },
"changedCells" : { "Text" : { "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Font" :
{ "@A" : "0", "@B" : "true", "@S" : "8", "@C" : "#000000", "@F" : "Arial" }, "Borders" : "", "Hyperlink" : "" },
"virtualCells" : { "Text" : { "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Font" :
{ "@A" : "0", "@S" : "8", "@C" : "#000000", "@F" : "Arial" }, "Borders" : "", "Hyperlink" : "" }, "table" :
{ "Name" : "EAX table style", "Range" : { "left" : "0", "top" : "0", "width" : "0", "height" : "0" }, "Corner" :
{ "Text" : { "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Fill" : {
"@C" : "#DEE5F8" }, "Font" : { "@A" : "0", "@S" : "8", "@C" : "#000000", "@F" : "Arial" }, "Borders" : "",
"Hyperlink" : "" }, "FirstRow" : { "Width" : "1", "Style" : { "Text" : { "@VA" : "-1",
"@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Fill" : { "@C" : "#FFFFFF" }, "Font" : {
"@A" : "0", "@S" : "8", "@C" : "#000000", "@F" : "Arial" }, "Borders" : "", "Hyperlink" : "" } }, "SecondRow" :
{ "Width" : "1", "Style" : { "Text" : { "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1"
}, "Fill" : { "@C" : "#ECEFF6" }, "Font" : { "@A" : "0", "@S" : "8", "@C" : "#000000",
"@F" : "Arial" }, "Borders" : "", "Hyperlink" : "" } }, "FirstColumn" : { "Width" : "1" },
"SecondColumn" : { "Width" : "1" }, "HeaderRow" : { "Width" : "1", "Style" : { "Text" :
{ "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Fill" : { "@C" : "#ECEFF6" },
"Font" : { "@A" : "0", "@S" : "8", "@C" : "#000000", "@F" : "Arial" }, "Borders" : { "Border" :
[ { "@S" : "0", "@C" : "#BBBBBB", "@I" : "2" }, { "@S" : "0", "@C" : "#BBBBBB", "@I" : "5"
}, { "@S" : "0", "@C" : "#FFFFFF", "@I" : "6" }, { "@S" : "0", "@C" : "#FFFFFF", "@I" : "7"
} ] }, "Hyperlink" : "" } }, "HeaderColumn" : { "Width" : "1", "Style" :
{ "Text" : { "@VA" : "-1", "@HA" : "-1", "@M" : "-3.78 -3.78 -3.78 -3.78", "@WW" : "-1" }, "Fill" : {
"@C" : "#DEE5F8" }, "Font" : { "@A" : "0", "@S" : "8", "@C" : "#000000", "@F" : "Arial" }, "Borders" :
{ "Border" : [ { "@S" : "0", "@C" : "#BBBBBB", "@I" : "3" }, { "@S" : "0",
"@C" : "#BBBBBB", "@I" : "4" }, { "@S" : "0", "@C" : "#FFFFFF", "@I" : "6" }, { "@S" : "0",
"@C" : "#FFFFFF", "@I" : "7" } ] }, "Hyperlink" : "" } }, "FooterRow" : {
"Width" : "0" }, "FooterColumn" : { "Width" : "0" }, "PredefinedStyle" : "ExtDarkBlueStriped", "IsEmpty" : "0" }, "calcs" : "",
"internalFormatConditions" : "", "totalsFormatConditions" : "", "ABCFormatConditions" : "", "rangeFormatConditions" : "" } }, "windowsPosition" : "Maximized", "hasPivot" : "1" } } }
public static OpenEaxResult OpenEaxEx(MbId mb, string eaxId, EaxMdPattern pattern)
{
var somClient = new SomPortTypeClient(); //Прокси-объект для выполнения операций
//Параметры выполнения операции
var tOpen = new OpenEax()
{
tArg = new OpenEaxArg()
{
args = new EaxOpenArgs() { openForEdit = true},
//Шаблон, в соответствии с которым будут извлекаться метаданные
metaGet = pattern
},
//Формирование моникера объекта
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, eaxId).k }
};
//Открытие экспресс-отчета
var result = somClient.OpenEax(tOpen);
return result;
}
См. также: