AddTabNamedRegion

Syntax

TabNamedRegionOpResult AddTabNamedRegion(NamedRegionsId nrMon, TabNamedRegion Region)

Parameters

nrMon. Moniker for working with named ranges.

Region. Parameters of added named range.

Description

The AddTabNamedRegion operation creates a named range on a regular report sheet.

Comments

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

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

Example

Below is the example of creating a named range on the first sheet of regular report. The request contains moniker for working with named ranges and created range settings. The response contains whether creation is successful and name of the created 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">
<AddTabNamedRegion xmlns="http://www.fsight.ru/PP.SOM.Som">
<nrMon xmlns="">
  <id>ILBNJNHKDBCAGOAEGGMCAJHIOKJPOKMEOIOADBDOFONILPAG!M!S!PAJBBFBIKDBCAGOAEJOAGHLNCNALCNCJEOLBLLFIDBFHIGLPO!Sheets!1!NamedRegions</id>
  </nrMon>
<Region xmlns="">
  <left>1</left>
  <top>1</top>
  <width>10</width>
  <height>2</height>
  <borderColor>4294901760</borderColor>
  <name>Header</name>
  </Region>
  </AddTabNamedRegion>
  </s:Body>
  </s:Envelope>

SOAP response:

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

JSON request:

{
"AddTabNamedRegion" :
{
"nrMon" :
{
"id" : "ILBNJNHKDBCAGOAEGGMCAJHIOKJPOKMEOIOADBDOFONILPAG!M!S!PAJBBFBIKDBCAGOAEJOAGHLNCNALCNCJEOLBLLFIDBFHIGLPO!Sheets!1!NamedRegions"
},
"Region" :
{
"left" : "1",
"top" : "1",
"width" : "10",
"height" : "2",
"borderColor" : "4294901760",
"name" : "Header"
}
}
}

JSON response:

{
"AddTabNamedRegionResult" :
{
"res" : "1",
"name" : "Header"
}
}
public static TabNamedRegionOpResult AddTabNamedRegion(string moniker, string regionName, int leftCell, int topCell, uint bottomCell, uint rightCell)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tAdd = new AddTabNamedRegion()
{
nrMon = new NamedRegionsId() { id = moniker + "!Sheets!1!NamedRegions" },
Region = new TabNamedRegion()
{
left = leftCell,
top = topCell,
height = bottomCell,
width = rightCell,
name = regionName,
borderColor = 4294901760 // Red
}
};
// Create a named range
var result = somClient.AddTabNamedRegion(tAdd);
return result;
}

See also:

Working with Regular Reports