ReportingService2005.SetItemDataSources(String, DataSource[]) Method


设置目录中项的数据源。Sets the data sources for an item in the catalog.

 void SetItemDataSources(System::String ^ Item, cli::array <ReportService2005::DataSource ^> ^ DataSources);
public void SetItemDataSources (string Item, ReportService2005.DataSource[] DataSources);
member this.SetItemDataSources : string * ReportService2005.DataSource[] -> unit
Public Sub SetItemDataSources (Item As String, DataSources As DataSource())



要设置其数据源的项的完整名称。The full name of the item for which to set the data sources. 接受由方法生成的 EditSessionID CreateReportEditSession(String, String, Byte[], Warning[])Accepts an EditSessionID generated by the CreateReportEditSession(String, String, Byte[], Warning[]) method.


一个 DataSource 对象数组。An array of DataSource objects.


下表显示了有关此操作的标头和权限信息。The table below shows header and permissions information on this operation.

SOAP 标头SOAP Headers (In) BatchHeaderValue(In) BatchHeaderValue

(Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue
所需的权限Required Permissions 取决于项类型 ItemDepends on the item type of Item:

- Report: UpdateDatasource- Report: UpdateDatasource
- Model: UpdateDatasource- Model: UpdateDatasource
-对于数组中的每个数据源或模型 DataSources- For each data source or model in the DataSources array:
- DataSource: ReadProperties- DataSource: ReadProperties
- Model: ReadProperties- Model: ReadProperties

SetItemDataSources 在链接报表项类型上设置数据源属性时,将返回错误。SetItemDataSources returns an error when data source properties are set on a linked report item type.

rsDataSourceNotFound如果未与项关联的数据源传入方法,则会返回错误。An rsDataSourceNotFound error is returned if a data source that is not associated with the item is passed into the method.

Item 类型为模型时,指定的值必须是单个值 DataSourceReferenceWhen the Item type is a model, the specified value must be a single DataSourceReference. 在这种情况下,如果提供对象的数组 DataSource ,则将返回错误。In this situation, if you supply an array of DataSource objects, an error is returned.

当指定的类型 Item 为模型时,指定的 DataSourceReference 不能引用模型或将数据源凭据设置为 PromptWhen the type of Item specified is a model, the DataSourceReference specified cannot reference a model or have data source credentials set to Prompt.

如果某个项上存在多个数据源,则只能提交正在更改的数据源。If multiple data sources exist on an item, only those data sources that are being changed may be submitted.

Applies to