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);
        }
        private void OnGetSubReportDefinition(ICatalogItemContext reportContext, string subreportPath, string newChunkName, ReportProcessing.NeedsUpgrade upgradeCheck, ParameterInfoCollection parentQueryParameters, out ICatalogItemContext subreportContext, out string description, out IChunkFactory chunkFactory, out ParameterInfoCollection parameters)
        {
            if (reportContext == null)
            {
                throw new ArgumentException("OnGetSubReportDefinition: Invalid report context");
            }
            if (upgradeCheck(ReportProcessingFlags.OnDemandEngine))
            {
                throw new Exception("Subreport definition is not compatible with this version of viewer controls");
            }
            subreportContext = reportContext.GetSubreportContext(subreportPath);
            ControlSnapshot  controlSnapshot = default(ControlSnapshot);
            PublishingResult compiledReport  = this.GetCompiledReport((PreviewItemContext)subreportContext, false, out controlSnapshot);

            controlSnapshot.PrepareExecutionSnapshot(this.m_executionSession.Snapshot, newChunkName);
            description  = compiledReport.ReportDescription;
            chunkFactory = controlSnapshot;
            parameters   = compiledReport.Parameters;
        }