Below is the example of using the SetEaxMd operation to change header and footer parameters. The request contains moniker of opened express report instance, the pattern indicating whether headers and footers must be changed, and metadata that contains parameters of various header and footer parts must be changed. The operation results in the moniker of the changed express report.
{
"Envelope" :
{
"Body" :
{
"SetEaxMd" :
{
"tEax" :
{
"id" : "S1!M!S!E1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "false",
"header" : "true",
"footer" : "true"
},
"meta" :
{
"header" :
{
"right" :
{
"text" : "&[Picture]",
"imageDocument" :
{
"@isShortcut" : "false",
"i" : "PP_LOGO",
"n" : "PP_logo.jpg",
"k" : "245",
"c" : "3329",
"p" : "4294967295",
"h" : "false"
},
"imageAsBackground" : "true"
},
"margin" :
{
"width" : "0",
"height" : "15",
"units" : "Mm"
}
},
"footer" :
{
"center" :
{
"textColor" : "#333366",
"text" : "Page &[Page] of &[Pages]"
},
"margin" :
{
"width" : "0",
"height" : "15",
"units" : "Mm"
}
}
}
"metaGet" :
{
"obInst" : "true",
"header" : "true",
"footer" : "true"
}
}
}
}
}
}
{
"Envelope" :
{
"Body" :
{
"SetEaxMdResult" :
{
"changedDims" : "",
"id" :
{
"id" : "S1!M!S!E1"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@isShortcut" : "0",
"i" : "EXPRESS_1",
"n" : "Express report",
"k" : "189",
"c" : "2561",
"p" : "182",
"h" : "0"
}
},
"windowsPosition" : "Maximized",
"header" :
{
"left" :
{
"font" :
{
"family" : "Arial",
"style" : "",
"size" :
{
"width" : "-1",
"height" : "10",
"units" : "DLU96"
}
},
"textColor" : "#000000",
"imageAsBackground" : "0",
"imageSize" :
{
"width" : "0",
"height" : "0",
"units" : "DLU96"
}
},
"center" :
{
"font" :
{
"family" : "Arial",
"style" : "",
"size" :
{
"width" : "-1",
"height" : "10",
"units" : "DLU96"
}
},
"textColor" : "#000000",
"imageAsBackground" : "0",
"imageSize" :
{
"width" : "0",
"height" : "0",
"units" : "DLU96"
}
},
"right" :
{
"font" :
{
"family" : "Arial",
"style" : "",
"size" :
{
"width" : "-1",
"height" : "10",
"units" : "DLU96"
}
},
"textColor" : "#000000",
"text" : "&[Picture]",
"imageDocument" :
{
"@isShortcut" : "0",
"i" : "PP_LOGO",
"n" : "PP_logo.jpg",
"k" : "245",
"c" : "3329",
"p" : "182",
"h" : "0"
},
"imageAsBackground" : "1",
"imageSize" :
{
"width" : "14",
"height" : "5",
"units" : "DLU96"
}
},
"margin" :
{
"width" : "-1",
"height" : "15000",
"units" : "Mkm"
}
},
"footer" :
{
"left" :
{
"font" :
{
"family" : "Arial",
"style" : "",
"size" :
{
"width" : "-1",
"height" : "10",
"units" : "DLU96"
}
},
"textColor" : "#000000",
"imageAsBackground" : "0",
"imageSize" :
{
"width" : "0",
"height" : "0",
"units" : "DLU96"
}
},
"center" :
{
"font" :
{
"family" : "Arial",
"style" : "",
"size" :
{
"width" : "-1",
"height" : "10",
"units" : "DLU96"
}
},
"textColor" : "#333366",
"text" : "Page &[Page] of &[Pages]",
"imageAsBackground" : "0"
"imageSize" :
{
"width" : "0",
"height" : "0",
"units" : "DLU96"
}
},
"right" :
{
"font" :
{
"family" : "Arial",
"style" : "",
"size" :
{
"width" : "-1",
"height" : "10",
"units" : "DLU96"
}
},
"textColor" : "#000000",
"imageAsBackground" : "0",
"imageSize" :
{
"width" : "0",
"height" : "0",
"units" : "DLU96"
}
},
"margin" :
{
"width" : "-1",
"height" : "15000",
"units" : "Mkm"
}
}
}
}
}
}
}
public static SetEaxMdResult SetPageHeader(MbId mb, EaxId moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for executing operations
//Operation execution parameters
var tEaxMd = new SetEaxMd()
{
tArg = new SetEaxMdArg()
{
//Pattern according to which metadata will change
pattern = new EaxMdPattern()
{
obInst = false,
header = true,
footer = true
},
meta = new EaxMd()
{
header = new EaxHeader() //Header
{
right = new GxHeaderPart()
{
imageDocument = FindObjectById(mb, "PP7_LOGO"),
imageAsBackground = true,
text = "&[Picture]"
},
margin = new SizeU() { height= 15 }
},
footer = new EaxHeader() //Нижний колонтитул
{
center = new GxHeaderPart()
{
text = "Страница &[Page] из &[Pages]",
textColor = "#333366"
},
margin = new SizeU() { height = 15 }
}
},
metaGet = new EaxMdPattern() { footer = true, header = true }
},
tEax = moniker
};
//Change header and footer parameters
var result = somClient.SetEaxMd(tEaxMd);
return result;
}
See also:
SOAP