private DataSourceInfoCollection ResolveSharedDataSources(DataSourceInfoCollection reportDataSources) { DataSourceInfoCollection dataSourceInfoCollection = new DataSourceInfoCollection(); foreach (DataSourceInfo reportDataSource in reportDataSources) { if (!reportDataSource.IsReference) { dataSourceInfoCollection.Add(reportDataSource); } else { string dataSourceReference = reportDataSource.DataSourceReference; DataSourceInfo sharedDataSource = this.GetSharedDataSource(dataSourceReference); if (sharedDataSource == null) { throw new ItemNotFoundException(dataSourceReference); } sharedDataSource.ID = reportDataSource.ID; sharedDataSource.Name = reportDataSource.Name; sharedDataSource.OriginalName = reportDataSource.OriginalName; dataSourceInfoCollection.Add(sharedDataSource); } } return(dataSourceInfoCollection); }
private DataSourceInfoCollection CompileDataSetsAndCombineDataSources(DataSetInfoCollection dataSets, DataSourceInfoCollection existingDataSources) { DataSourceInfoCollection dataSourceInfoCollection = new DataSourceInfoCollection(existingDataSources); foreach (DataSetInfo dataSet in dataSets) { ICatalogItemContext dataSetContext = this.m_itemContext.GetDataSetContext(dataSet.AbsolutePath); DataSetPublishingResult compiledDataSet = this.GetCompiledDataSet(dataSet, dataSetContext); compiledDataSet.DataSourceInfo.OriginalName = compiledDataSet.DataSourceInfo.ID.ToString(); dataSourceInfoCollection.Add(compiledDataSet.DataSourceInfo); dataSet.DataSourceId = compiledDataSet.DataSourceInfo.ID; } return(dataSourceInfoCollection); }