private DataSetPublishingResult GetCompiledDataSet(DataSetInfo dataSetInfo, ICatalogItemContext dataSetContext)
        {
            StoredDataSet storedDataSet = this.m_catalogTempDB.GetCompiledDataSet(dataSetInfo);

            if (storedDataSet != null && !storedDataSet.Definition.SequenceEqual(dataSetInfo.Definition))
            {
                storedDataSet = null;
            }
            if (storedDataSet == null)
            {
                DataSetPublishingResult result = default(DataSetPublishingResult);
                try
                {
                    using (ControlSnapshot createChunkFactory = new ControlSnapshot())
                    {
                        ReportProcessing  reportProcessing = this.CreateAndConfigureReportProcessing();
                        PublishingContext sharedDataSetPublishingContext = new PublishingContext(dataSetContext, dataSetInfo.Definition, createChunkFactory, AppDomain.CurrentDomain, true, this.GetDataSourceForSharedDataSetHandler, reportProcessing.Configuration);
                        result = reportProcessing.CreateSharedDataSet(sharedDataSetPublishingContext);
                    }
                }
                catch (Exception inner)
                {
                    throw new DefinitionInvalidException(dataSetInfo.AbsolutePath, inner);
                }
                storedDataSet = new StoredDataSet(dataSetInfo.Definition, result);
                this.m_catalogTempDB.SetCompiledDataSet(dataSetInfo, storedDataSet);
            }
            return(storedDataSet.PublishingResult);
        }
        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);
        }
Exemple #3
0
 public StoredDataSet(byte[] dataSetDefinition, DataSetPublishingResult result)
 {
     this.Definition       = dataSetDefinition;
     this.PublishingResult = result;
 }