SetDataAreaSources

Syntax

bool SetDataAreaSources(string mon, DataAreaSources tArg)

Parameters

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

tArg. Operation execution parameters.

Description

The SetDataAreaSources operation changes data sources of analytical data area.

Comments

The operation changes settings of data sources, their slices, and visualizers that display slice data.

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 updated source metadata that should be applied. Keys should also be specified for the elements, which parameters are to be changed.

The moniker can be obtained on executing the OpenPrxMeta operation.

The operation returns True if changes are made successfully.

Example

Below is the example of renaming data source's slice. The request contains moniker for working with data sources, key of the data source, for which changes are made, slice key, and a new slice name. The response contains whether changes are applied successfully.

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">
<SetDataAreaSources xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">S1!M!S!P1!DataArea!DataSources</mon>
<tArg xmlns="">
<its>
<it>
  <k>1</k>
<slices>
<its>
<it>
  <k>1</k>
  <n>Data slice</n>
  </it>
  </its>
  </slices>
  </it>
  </its>
  </tArg>
  </SetDataAreaSources>
  </s:Body>
  </s:Envelope>

SOAP response:

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

JSON request:

{
"SetDataAreaSources" :
{
"mon" : "S1!M!S!P1!DataArea!DataSources",
"tArg" :
{
"its" :
{
"it" :
[
{
"k" : "1",
"slices" :
{
"its" :
{
"it" :
[
{
"k" : "1",
"n" : "Data slice"
}
]
}
}
}
]
}
}
}
}

JSON response:

{
"SetDataAreaSourcesResult" : "1"
}
public static bool ChangePrxDataSource(string moniker, uint dataSourceKey, uint sliceKey)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetDataAreaSources()
{
tArg = new DataAreaSources()
{
its = new DataAreaSource[1]
{
new DataAreaSource()
{
k = dataSourceKey,
slices = new DataAreaSlices()
{
its = new DataAreaSlice[1]
{
new DataAreaSlice()
{
k = sliceKey,
n = "Data slice" //New name for data slice
}
}
}
}
}
},
mon = moniker + "!DataArea!DataSources"
};
//Change data source parameters
var result = somClient.SetDataAreaSources(tSet);
return result;
}

See also:

Working With Regular Reports