DataAreaSourcesAdd

Syntax

OpItemKey DataAreaSourcesAdd(string mon, DataAreaSourcesAddArg tArg)

Parameters

mon. Moniker for working with data sources of regular report analytical data area.

tArg. Operation execution parameters.

Description

The DataAreaSourcesAdd operation adds a new data source for analytical data area.

Comments

To execute the operation, in the mon field specify moniker of opened regular report instance with the !DataArea!DataSources postfix to work with data sources, and in the tArg field specify parameters for adding a new data source.

The moniker can be obtained on executing the OpenPrxMeta operation.

In the tArg.obDesc field specify description of the cube that should be added as a data source.

Example

Below is the example of adding a data source for analytical data area. The request contains moniker for working with data sources and description of the cube that will be used as a data source. The response contains key of the created data source.

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">
<DataAreaSourcesAdd xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">S1!M!S!P1!DataArea!DataSources</mon>
<tArg xmlns="">
<cube>
<obDesc>
  <i>CALC_CUBE</i>
  <n>Calculated cube</n>
  <k>6962</k>
  <c>0</c>
  </obDesc>
  </cube>
  </tArg>
  </DataAreaSourcesAdd>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<DataAreaSourcesAddResult 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">
  <k xmlns="">3</k>
  </DataAreaSourcesAddResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"DataAreaSourcesAdd" :
{
"mon" : "S1!M!S!P1!DataArea!DataSources",
"tArg" :
{
"cube" :
{
"obDesc" :
{
"i" : "CALC_CUBE",
"n" : "Calculated cube",
"k" : "6962",
"c" : "0"
}
}
}
}
}

JSON response:

{
"DataAreaSourcesAddResult" :
{
"k" : "3"
}
}
public static OpItemKey AddDataSource(MbId mb, string moniker, string cubeId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Cube description
var cubeOd = FindObjectById(mb, cubeId);
//Operation execution parameters
var tAdd = new DataAreaSourcesAdd()
{
tArg = new DataAreaSourcesAddArg()
{
cube = new CubeDataSource()
{
obDesc = new Ob()
{
i = cubeId,
n = cubeOd.n,
k = cubeOd.k
}
}
},
mon = moniker + "!DataArea!DataSources"
};
//Add a data source
var result = somClient.DataAreaSourcesAdd(tAdd);
return result;
}

See also:

Working with Regular Reports