OpItemKey DataAreaSourcesAdd(string mon, DataAreaSourcesAddArg tArg)
mon. Moniker for working with data sources of regular report analytical data area.
tArg. Operation execution parameters.
The DataAreaSourcesAdd operation adds a new data source for analytical data area.
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.
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.
{
"DataAreaSourcesAdd" :
{
"mon" : "S1!M!S!P1!DataArea!DataSources",
"tArg" :
{
"cube" :
{
"obDesc" :
{
"i" : "CALC_CUBE",
"n" : "Calculated cube",
"k" : "6962",
"c" : "0"
}
}
}
}
}
{
"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: