private DataSetInfoCollection ResolveSharedDataSets(DataSetInfoCollection reportDataSets) { DataSetInfoCollection dataSetInfoCollection = new DataSetInfoCollection(); foreach (DataSetInfo reportDataSet in reportDataSets) { DataSetInfo dataSetInfo; if (reportDataSet.IsValidReference()) { dataSetInfo = reportDataSet; } else { dataSetInfo = this.m_catalog.GetDataSet(reportDataSet.AbsolutePath); if (dataSetInfo == null) { throw new ItemNotFoundException(reportDataSet.DataSetName); } dataSetInfo.ID = reportDataSet.ID; dataSetInfo.DataSetName = reportDataSet.DataSetName; } dataSetInfoCollection.Add(dataSetInfo); } return(dataSetInfoCollection); }
public void SubReportDataSourcesCallback(ICatalogItemContext reportContext, string subreportPath, out ICatalogItemContext subreportContext, out ReportProcessing.GetReportChunk getCompiledDefinitionCallback, out DataSourceInfoCollection dataSources) { getCompiledDefinitionCallback = null; IChunkFactory chunkFactory = null; DataSetInfoCollection dataSetInfoCollection = default(DataSetInfoCollection); this.m_subreportDataSourcesCallback(reportContext, subreportPath, this.NeedsUpgrade, out subreportContext, out chunkFactory, out dataSources, out dataSetInfoCollection); if (chunkFactory != null) { if (ReportProcessing.ContainsFlag(chunkFactory.ReportProcessingFlags, ReportProcessingFlags.OnDemandEngine)) { subreportContext = null; getCompiledDefinitionCallback = null; dataSources = null; string text = subreportPath.MarkAsPrivate(); string text2 = reportContext.ItemPathAsString.MarkAsPrivate(); Global.Tracer.Trace(TraceLevel.Warning, "The subreport '{0}' could not be processed. Parent report '{1}' failed to automatically republish, or it contains a Reporting Services 2005-style CustomReportItem, and is therefore incompatible with the subreport. To correct this error, please attempt to republish the parent report manually. If it contains a CustomReportItem, please upgrade the report to the latest version.", text, text2); throw new ReportProcessingException(ErrorCode.rsInvalidOperation, RPRes.rsEngineMismatchParentReport(ObjectType.Subreport.ToString(), text, null, text, text2)); } ChunkFactoryAdapter @object = new ChunkFactoryAdapter(chunkFactory); getCompiledDefinitionCallback = @object.GetReportChunk; return; } if (subreportContext != null) { return; } throw new ReportProcessingException(RPRes.rsMissingSubReport(subreportPath, subreportPath), ErrorCode.rsItemNotFound); }
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); }
private void GetAllReportDataSourcesAndSharedDataSets(out RuntimeDataSourceInfoCollection runtimeDataSources, out RuntimeDataSetInfoCollection runtimeDataSets) { if (!DataRetrieval.SupportsQueries) { runtimeDataSources = new RuntimeDataSourceInfoCollection(); runtimeDataSets = new RuntimeDataSetInfoCollection(); return; } ControlSnapshot snapshot; PublishingResult compiledReport = GetCompiledReport(m_itemContext, rebuild: false, out snapshot); DataSourceInfoCollection existingDataSources = ResolveSharedDataSources(compiledReport.DataSources); DataSetInfoCollection dataSetInfoCollection = ResolveSharedDataSets(compiledReport.SharedDataSets); DataSourceInfoCollection dataSources = CompileDataSetsAndCombineDataSources(dataSetInfoCollection, existingDataSources); CreateAndConfigureReportProcessing().GetAllDataSources(m_itemContext, snapshot, OnGetSubReportDataSources, dataSources, dataSetInfoCollection, checkIfUsable: true, new ServerDataSourceSettings(isSurrogatePresent: true, allowIntegratedSecurity: true), out runtimeDataSources, out runtimeDataSets); }
private void GetAllReportDataSourcesAndSharedDataSets(out RuntimeDataSourceInfoCollection runtimeDataSources, out RuntimeDataSetInfoCollection runtimeDataSets) { if (!this.DataRetrieval.SupportsQueries) { runtimeDataSources = new RuntimeDataSourceInfoCollection(); runtimeDataSets = new RuntimeDataSetInfoCollection(); } else { ControlSnapshot getCompiledDefinitionFactory = default(ControlSnapshot); PublishingResult compiledReport = this.GetCompiledReport(this.m_itemContext, false, out getCompiledDefinitionFactory); DataSourceInfoCollection existingDataSources = this.ResolveSharedDataSources(compiledReport.DataSources); DataSetInfoCollection dataSetInfoCollection = this.ResolveSharedDataSets(compiledReport.SharedDataSets); DataSourceInfoCollection dataSources = this.CompileDataSetsAndCombineDataSources(dataSetInfoCollection, existingDataSources); ReportProcessing reportProcessing = this.CreateAndConfigureReportProcessing(); reportProcessing.GetAllDataSources((ICatalogItemContext)this.m_itemContext, (IChunkFactory)getCompiledDefinitionFactory, (ReportProcessing.OnDemandSubReportDataSourcesCallback) this.OnGetSubReportDataSources, dataSources, dataSetInfoCollection, true, new ServerDataSourceSettings(true, true), out runtimeDataSources, out runtimeDataSets); } }
public PublishingResult(string reportDescription, string reportLanguage, ParameterInfoCollection parameters, DataSourceInfoCollection dataSources, DataSetInfoCollection sharedDataSetReferences, ProcessingMessageList warnings, UserLocationFlags userReferenceLocation, double pageHeight, double pageWidth, double topMargin, double bottomMargin, double leftMargin, double rightMargin, ArrayList dataSetsName, bool hasExternalImages, bool hasHyperlinks, ReportProcessingFlags reportProcessingFlags, byte[] dataSetsHash) { this.m_reportDescription = reportDescription; this.m_reportLanguage = reportLanguage; this.m_parameters = parameters; this.m_dataSources = dataSources; this.m_sharedDataSets = sharedDataSetReferences; this.m_warnings = warnings; this.m_userReferenceLocation = userReferenceLocation; this.m_hasExternalImages = hasExternalImages; this.m_hasHyperlinks = hasHyperlinks; this.m_reportProcessingFlags = reportProcessingFlags; this.m_dataSetsHash = dataSetsHash; this.m_pageProperties = new PageProperties(pageHeight, pageWidth, topMargin, bottomMargin, leftMargin, rightMargin); if (dataSetsName != null && dataSetsName.Count > 0) { this.m_dataSetsName = (string[])dataSetsName.ToArray(typeof(string)); } }
protected PublishingContextBase(PublishingContextKind publishingContextKind, ICatalogItemContext catalogContext, IChunkFactory createChunkFactory, AppDomain compilationTempAppDomain, bool generateExpressionHostWithRefusedPermissions, ReportProcessingFlags processingFlags, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.CheckSharedDataSource checkDataSourceCallback, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ResolveTemporaryDataSource resolveTemporaryDataSourceCallback, DataSourceInfoCollection originalDataSources, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.CheckSharedDataSet checkDataSetCallback, AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ResolveTemporaryDataSet resolveTemporaryDataSetCallback, DataSetInfoCollection originalDataSets, IConfiguration configuration, IDataProtection dataProtection, bool isInternalRepublish, bool isPackagedReportArchive, bool isRdlx, bool traceAtomicScopes) { this.m_publishingContextKind = publishingContextKind; this.m_catalogContext = catalogContext; this.m_createChunkFactory = createChunkFactory; this.m_compilationTempAppDomain = compilationTempAppDomain; this.m_generateExpressionHostWithRefusedPermissions = generateExpressionHostWithRefusedPermissions; this.m_processingFlags = processingFlags; this.m_checkDataSourceCallback = checkDataSourceCallback; this.m_checkDataSetCallback = checkDataSetCallback; this.m_resolveTemporaryDataSourceCallback = resolveTemporaryDataSourceCallback; this.m_resolveTemporaryDataSetCallback = resolveTemporaryDataSetCallback; this.m_originalDataSources = originalDataSources; this.m_originalDataSets = originalDataSets; this.m_configuration = configuration; this.m_dataProtection = dataProtection; this.m_isInternalRepublish = isInternalRepublish; this.m_traceAtomicScopes = traceAtomicScopes; this.m_isPackagedReportArchive = isPackagedReportArchive; this.m_isRdlx = isRdlx; this.m_publishingVersioning = new PublishingVersioning(this.m_configuration, this); }
public PublishingContext(ICatalogItemContext catalogContext, byte[] reportDefinition, IChunkFactory createChunkFactory, AppDomain compilationTempAppDomain, bool generateExpressionHostWithRefusedPermissions, ReportProcessingFlags processingFlags, ReportProcessing.CheckSharedDataSource checkDataSourceCallback, ReportProcessing.ResolveTemporaryDataSource resolveTemporaryDataSourceCallback, DataSourceInfoCollection originalDataSources, ReportProcessing.CheckSharedDataSet checkDataSetCallback, ReportProcessing.ResolveTemporaryDataSet resolveTemporaryDataSetCallback, DataSetInfoCollection originalDataSets, IConfiguration configuration, IDataProtection dataProtection, bool isInternalRepublish, bool isPackagedReportArchive, bool isRdlx) : base(PublishingContextKind.Full, catalogContext, createChunkFactory, compilationTempAppDomain, generateExpressionHostWithRefusedPermissions, processingFlags, checkDataSourceCallback, resolveTemporaryDataSourceCallback, originalDataSources, checkDataSetCallback, resolveTemporaryDataSetCallback, originalDataSets, configuration, dataProtection, isInternalRepublish, isPackagedReportArchive, isRdlx, traceAtomicScopes : false) { m_definition = reportDefinition; }
private void OnGetSubReportDataSources(ICatalogItemContext itemContext, string subreportPath, ReportProcessing.NeedsUpgrade upgradeCheck, out ICatalogItemContext subreportContext, out IChunkFactory getCompiledDefinition, out DataSourceInfoCollection dataSources, out DataSetInfoCollection dataSets) { subreportPath = this.NormalizeSubReportPath(subreportPath); subreportContext = itemContext.GetSubreportContext(subreportPath); RSTrace.ReportPreviewTracer.Trace(TraceLevel.Info, "Getting datasources information for {0}.", subreportContext.ItemPathAsString); ControlSnapshot controlSnapshot = default(ControlSnapshot); PublishingResult compiledReport = this.GetCompiledReport((PreviewItemContext)subreportContext, false, out controlSnapshot); getCompiledDefinition = controlSnapshot; dataSources = this.ResolveSharedDataSources(compiledReport.DataSources); dataSets = this.ResolveSharedDataSets(compiledReport.SharedDataSets); }