ChangeTabNamedRegion

Syntax

TabNamedRegionOpResult ChangeTabNamedRegion(NamedRegionsId nrMon, ChangeTabRegionArg Arg)

Parameters

nrMon. Moniker for working with named ranges.

Arg. Operation execution parameters.

Description

The ChangeTabNamedRegion operation changes a table named range.

Comments

To execute the operation, in the nrMon field specify regular report instance moniker with the !Sheets!Sheet key!NamedRegions postfix, and in the Arg field specify named range change parameters. The moniker can be obtained on executing the OpenPrxMeta operation.

The operation results in the information about successful named range change.

Example

Below is the example of changing a named range. The request contains moniker for working with named ranges, name of changed range and new settings. The response contains whether change is successful and new name of the named range.

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">
<ChangeTabNamedRegion xmlns="http://www.fsight.ru/PP.SOM.Som">
<nrMon xmlns="">
  <id>ILBNJNHKDBCAGOAEGGMCAJHIOKJPOKMEOIOADBDOFONILPAG!M!S!PAJBBFBIKDBCAGOAEJOAGHLNCNALCNCJEOLBLLFIDBFHIGLPO!Sheets!1!NamedRegions</id>
  </nrMon>
<Arg xmlns="">
<ids>
  <name>Data</name>
  </ids>
<reg>
  <left>1</left>
  <top>11</top>
  <width>10</width>
  <height>12</height>
  <name>Totals</name>
  </reg>
  </Arg>
  </ChangeTabNamedRegion>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ChangeTabNamedRegionResult 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">
  <res xmlns="">1</res>
  <name xmlns="">Totals</name>
  </ChangeTabNamedRegionResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"ChangeTabNamedRegion" :
{
"nrMon" :
{
"id" : "ILBNJNHKDBCAGOAEGGMCAJHIOKJPOKMEOIOADBDOFONILPAG!M!S!PAJBBFBIKDBCAGOAEJOAGHLNCNALCNCJEOLBLLFIDBFHIGLPO!Sheets!1!NamedRegions"
},
"Arg" :
{
"ids" :
{
"name" : "Data"
},
"reg" :
{
"left" : "1",
"top" : "11",
"width" : "10",
"height" : "12",
"name" : "Totals"
}
}
}
}

JSON response:

{
"ChangeTabNamedRegionResult" :
{
"res" : "1",
"name" : "Totals"
}
}
public static TabNamedRegionOpResult ChangeTabNamedRegion(string moniker, string changedRegionName, string newName, int leftCell, int topCell, uint bottomCell, uint rightCell)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tChange = new ChangeTabNamedRegion()
{
nrMon = new NamedRegionsId() { id = moniker + "!Sheets!1!NamedRegions" },
Arg = new ChangeTabRegionArg()
{
ids = new TabRegionIdentArg()
{
name = changedRegionName
},
reg = new TabNamedRegion()
{
left = leftCell,
top = topCell,
height = bottomCell,
width = rightCell,
name = newName
}
}
};
// Change named range
var result = somClient.ChangeTabNamedRegion(tChange);
return result;
}

See also:

Working with Regular Reports