Changing Header and Footer Parameters

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetEaxMd xmlns="http://www.fsight.ru/PP.SOM.Som">
<tEax xmlns=" ">
  <id>S1!M!S!E1</id>
  </tEax>
<tArg xmlns=" ">
<pattern>
  <obInst>false</obInst>
  <header>true</header>
  <footer>true</footer>
  </pattern>
<meta>
<header>
<right>
  <text>&[Picture]</text>
<imageDocument isShortcut="false">
  <i>PP_LOGO</i>
  <n>PP_logo.jpg</n>
  <k>245</k>
  <c>3329</c>
  <p>4294967295</p>
  <h>false</h>
  </imageDocument>
  <imageAsBackground>true</imageAsBackground>
  </right>
<margin>
  <width>0</width>
  <height>15</height>
  <units>Mm</units>
  </margin>
  </header>
<footer>
<center>
  <textColor>#333366</textColor>
  <text>Page &[Page] of &[Pages]</text>
  </center>
<margin>
  <width>0</width>
  <height>15</height>
  <units>Mm</units>
  </margin>
  </footer>
  </meta>
<metaGet>
  <obInst>true</obInst>
  <header>true</header>
  <footer>true</footer>
  </metaGet>
  </tArg>
  </SetEaxMd>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetEaxMdResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <changedDims xmlns=" " />
<id xmlns=" ">
  <id>S1!M!S!E1</id>
  </id>
<meta xmlns=" ">
<obInst>
<obDesc isShortcut="0">
  <i>EXPRESS_1</i>
  <n>Express report</n>
  <k>189</k>
  <c>2561</c>
  <p>182</p>
  <h>0</h>
  </obDesc>
  </obInst>
  <windowsPosition>Maximized</windowsPosition>
<header>
<left>
<font>
  <family>Arial</family>
  <style />
<size>
  <width>-1</width>
  <height>10</height>
  <units>DLU96</units>
  </size>
  </font>
  <textColor>#000000</textColor>
  <imageAsBackground>0</imageAsBackground>
<imageSize>
  <width>0</width>
  <height>0</height>
  <units>DLU96</units>
  </imageSize>
  </left>
<center>
<font>
  <family>Arial</family>
  <style />
<size>
  <width>-1</width>
  <height>10</height>
  <units>DLU96</units>
  </size>
  </font>
  <textColor>#000000</textColor>
  <imageAsBackground>0</imageAsBackground>
<imageSize>
  <width>0</width>
  <height>0</height>
  <units>DLU96</units>
  </imageSize>
  </center>
<right>
<font>
  <family>Arial</family>
  <style />
<size>
  <width>-1</width>
  <height>10</height>
  <units>DLU96</units>
  </size>
  </font>
  <textColor>#000000</textColor>
  <text>&[Picture]</text>
<imageDocument isShortcut="0">
  <i>PP_LOGO</i>
  <n>PP_logo.jpg</n>
  <k>245</k>
  <c>3329</c>
  <p>182</p>
  <h>0</h>
  </imageDocument>
  <imageAsBackground>1</imageAsBackground>
<imageSize>
  <width>14</width>
  <height>5</height>
  <units>DLU96</units>
  </imageSize>
  </right>
<margin>
  <width>-1</width>
  <height>15000</height>
  <units>Mkm</units>
  </margin>
  </header>
<footer>
<left>
<font>
  <family>Arial</family>
  <style />
<size>
  <width>-1</width>
  <height>10</height>
  <units>DLU96</units>
  </size>
  </font>
  <textColor>#000000</textColor>
  <imageAsBackground>0</imageAsBackground>
<imageSize>
  <width>0</width>
  <height>0</height>
  <units>DLU96</units>
  </imageSize>
  </left>
<center>
<font>
  <family>Arial</family>
  <style />
<size>
  <width>-1</width>
  <height>10</height>
  <units>DLU96</units>
  </size>
  </font>
  <textColor>#333366</textColor>
  <text>Page &[Page] of &[Pages]</text>
  <imageAsBackground>0</imageAsBackground>
<imageSize>
  <width>0</width>
  <height>0</height>
  <units>DLU96</units>
  </imageSize>
  </center>
<right>
<font>
  <family>Arial</family>
  <style />
<size>
  <width>-1</width>
  <height>10</height>
  <units>DLU96</units>
  </size>
  </font>
  <textColor>#000000</textColor>
  <imageAsBackground>0</imageAsBackground>
<imageSize>
  <width>0</width>
  <height>0</height>
  <units>DLU96</units>
  </imageSize>
  </right>
<margin>
  <width>-1</width>
  <height>15000</height>
  <units>Mkm</units>
  </margin>
  </footer>
  </meta>
  </SetEaxMdResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
 "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"
          }
        }
      }
    }
  }
}

JSON response:

{
 "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 operation execution
//Operation execution parameters
var tEaxMd = new SetEaxMd()
{
tArg = new SetEaxMdArg()
{
//Pattern that will be used to change metadata
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() //Footer
{
center = new GxHeaderPart()
{
text = "Page &[Page] of &[Pages]",
textColor = "#333366"
},
margin = new SizeU() { height = 15 }
}
},
metaGet = new EaxMdPattern() { footer = true, header = true }
},
tEax = moniker
};
//Change headers and footers parameters
var result = somClient.SetEaxMd(tEaxMd);
return result;
}

See also:

SetEaxMd: Operation