示例#1
0
 internal void UpdateSubReportContents(SubReport subReport, Microsoft.ReportingServices.ReportRendering.SubReport renderSubreport)
 {
     if (renderSubreport != null)
     {
         m_renderReport = renderSubreport.Report;
     }
     if (m_reportSections != null)
     {
         m_reportSections[0].UpdateSubReportContents(m_renderReport);
     }
     if (m_parameters != null)
     {
         m_parameters.UpdateRenderReportItem(m_renderReport.Parameters);
     }
 }
示例#2
0
 internal void RetrieveSubreport()
 {
     if (!m_isNewContext)
     {
         return;
     }
     if (m_isOldSnapshot)
     {
         Microsoft.ReportingServices.ReportRendering.SubReport subReport = (Microsoft.ReportingServices.ReportRendering.SubReport)m_renderReportItem;
         if (subReport.Report != null)
         {
             if (m_report == null)
             {
                 m_report = new Report(this, m_inSubtotal, subReport, m_renderingContext);
             }
             else
             {
                 m_report.UpdateSubReportContents(this, subReport);
             }
         }
         m_noRows             = subReport.NoRows;
         m_processedWithError = subReport.ProcessedWithError;
     }
     else
     {
         Microsoft.ReportingServices.ReportIntermediateFormat.SubReport subReport2 = (Microsoft.ReportingServices.ReportIntermediateFormat.SubReport)m_reportItemDef;
         RenderingContext renderingContext = null;
         try
         {
             if (subReport2.ExceededMaxLevel)
             {
                 m_errorCode    = SubReportErrorCodes.ExceededMaxRecursionLevel;
                 m_errorMessage = RPRes.rsExceededMaxRecursionLevel(subReport2.Name);
                 FinalizeErrorMessageAndThrow();
             }
             else
             {
                 CheckRetrievalStatus(subReport2.RetrievalStatus);
             }
             if (m_renderingContext.InstanceAccessDisallowed)
             {
                 renderingContext = GetOrCreateRenderingContext(subReport2, null);
                 renderingContext.SubReportHasNoInstance = true;
             }
             else
             {
                 m_renderingContext.OdpContext.SetupContext(subReport2, base.Instance.ReportScopeInstance);
                 if (subReport2.CurrentSubReportInstance == null)
                 {
                     renderingContext = GetOrCreateRenderingContext(subReport2, null);
                     renderingContext.SubReportHasNoInstance = true;
                 }
                 else
                 {
                     Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = subReport2.CurrentSubReportInstance.Value();
                     m_noRows             = subReportInstance.NoRows;
                     m_processedWithError = subReportInstance.ProcessedWithError;
                     if (m_processedWithError)
                     {
                         CheckRetrievalStatus(subReportInstance.RetrievalStatus);
                     }
                     Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance = subReportInstance.ReportInstance.Value();
                     renderingContext = GetOrCreateRenderingContext(subReport2, reportInstance);
                     renderingContext.OdpContext.LoadExistingSubReportDataChunkNameModifier(subReportInstance);
                     renderingContext.OdpContext.SetSubReportContext(subReportInstance, setupReportOM: true);
                     reportInstance.SetupEnvironment(renderingContext.OdpContext);
                 }
             }
         }
         catch (Exception e)
         {
             m_processedWithError = true;
             ErrorContext subReportErrorContext = null;
             if (subReport2.OdpContext != null)
             {
                 subReportErrorContext = subReport2.OdpContext.ErrorContext;
             }
             if (renderingContext == null && m_report != null)
             {
                 renderingContext = m_report.RenderingContext;
             }
             Microsoft.ReportingServices.ReportProcessing.ReportProcessing.HandleSubReportProcessingError(m_renderingContext.OdpContext.TopLevelContext.ErrorContext, subReport2, subReport2.UniqueName, subReportErrorContext, e);
         }
         if (renderingContext != null)
         {
             renderingContext.SubReportProcessedWithError = m_processedWithError;
         }
     }
     if (m_processedWithError)
     {
         m_noRows = false;
         if (m_errorCode == SubReportErrorCodes.Success)
         {
             m_errorCode    = SubReportErrorCodes.ProcessingError;
             m_errorMessage = RPRes.rsRenderSubreportError;
         }
     }
     m_isNewContext = false;
 }
示例#3
0
 internal SubReport(IDefinitionPath parentDefinitionPath, int indexIntoParentCollectionDef, bool inSubtotal, Microsoft.ReportingServices.ReportRendering.SubReport renderSubReport, RenderingContext renderingContext)
     : base(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, renderSubReport, renderingContext)
 {
 }
        internal static ReportItem CreateItem(string uniqueName, Microsoft.ReportingServices.ReportProcessing.ReportItem reportItemDef, ReportItemInstance reportItemInstance, RenderingContext renderingContext, NonComputedUniqueNames nonComputedUniqueNames)
        {
            if (reportItemDef == null)
            {
                return(null);
            }
            Global.Tracer.Assert(renderingContext != null);
            ReportItem reportItem    = null;
            int        intUniqueName = 0;

            NonComputedUniqueNames[] childrenNonComputedUniqueNames = null;
            if (reportItemInstance != null)
            {
                intUniqueName = reportItemInstance.UniqueName;
            }
            else if (nonComputedUniqueNames != null)
            {
                intUniqueName = nonComputedUniqueNames.UniqueName;
                childrenNonComputedUniqueNames = nonComputedUniqueNames.ChildrenUniqueNames;
            }
            if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Line)
            {
                Microsoft.ReportingServices.ReportProcessing.Line reportItemDef2 = (Microsoft.ReportingServices.ReportProcessing.Line)reportItemDef;
                LineInstance reportItemInstance2 = (LineInstance)reportItemInstance;
                reportItem = new Line(uniqueName, intUniqueName, reportItemDef2, reportItemInstance2, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.CheckBox)
            {
                Microsoft.ReportingServices.ReportProcessing.CheckBox reportItemDef3 = (Microsoft.ReportingServices.ReportProcessing.CheckBox)reportItemDef;
                CheckBoxInstance reportItemInstance3 = (CheckBoxInstance)reportItemInstance;
                reportItem = new CheckBox(uniqueName, intUniqueName, reportItemDef3, reportItemInstance3, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Image)
            {
                Microsoft.ReportingServices.ReportProcessing.Image reportItemDef4 = (Microsoft.ReportingServices.ReportProcessing.Image)reportItemDef;
                ImageInstance reportItemInstance4 = (ImageInstance)reportItemInstance;
                reportItem = new Image(uniqueName, intUniqueName, reportItemDef4, reportItemInstance4, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.TextBox)
            {
                Microsoft.ReportingServices.ReportProcessing.TextBox reportItemDef5 = (Microsoft.ReportingServices.ReportProcessing.TextBox)reportItemDef;
                TextBoxInstance reportItemInstance5 = (TextBoxInstance)reportItemInstance;
                reportItem = new TextBox(uniqueName, intUniqueName, reportItemDef5, reportItemInstance5, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Rectangle)
            {
                Microsoft.ReportingServices.ReportProcessing.Rectangle reportItemDef6 = (Microsoft.ReportingServices.ReportProcessing.Rectangle)reportItemDef;
                RectangleInstance reportItemInstance6 = (RectangleInstance)reportItemInstance;
                reportItem = new Rectangle(uniqueName, intUniqueName, reportItemDef6, reportItemInstance6, renderingContext, childrenNonComputedUniqueNames);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.ActiveXControl)
            {
                Microsoft.ReportingServices.ReportProcessing.ActiveXControl reportItemDef7 = (Microsoft.ReportingServices.ReportProcessing.ActiveXControl)reportItemDef;
                ActiveXControlInstance reportItemInstance7 = (ActiveXControlInstance)reportItemInstance;
                reportItem = new ActiveXControl(uniqueName, intUniqueName, reportItemDef7, reportItemInstance7, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.SubReport)
            {
                Microsoft.ReportingServices.ReportProcessing.SubReport subReport = (Microsoft.ReportingServices.ReportProcessing.SubReport)reportItemDef;
                SubReportInstance subReportInstance = (SubReportInstance)reportItemInstance;
                bool   processedWithError           = false;
                Report innerReport;
                if (Microsoft.ReportingServices.ReportProcessing.SubReport.Status.Retrieved != subReport.RetrievalStatus)
                {
                    innerReport        = null;
                    processedWithError = true;
                }
                else
                {
                    if (subReport.ReportContext == null && renderingContext.CurrentReportContext != null)
                    {
                        subReport.ReportContext = renderingContext.CurrentReportContext.GetSubreportContext(subReport.ReportPath);
                    }
                    ICatalogItemContext reportContext     = subReport.ReportContext;
                    RenderingContext    renderingContext2 = new RenderingContext(renderingContext, subReport.Uri, subReport.Report.EmbeddedImages, subReport.Report.ImageStreamNames, reportContext);
                    if (subReportInstance == null)
                    {
                        innerReport = new Report(subReport.Report, null, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                    else if (subReportInstance.ReportInstance == null)
                    {
                        processedWithError = true;
                        innerReport        = new Report(subReport.Report, null, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                    else
                    {
                        innerReport = new Report(subReport.Report, subReportInstance.ReportInstance, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                }
                reportItem = new SubReport(intUniqueName, subReport, subReportInstance, renderingContext, innerReport, processedWithError);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.List)
            {
                Microsoft.ReportingServices.ReportProcessing.List reportItemDef8 = (Microsoft.ReportingServices.ReportProcessing.List)reportItemDef;
                ListInstance reportItemInstance8 = (ListInstance)reportItemInstance;
                reportItem = new List(intUniqueName, reportItemDef8, reportItemInstance8, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Matrix)
            {
                Microsoft.ReportingServices.ReportProcessing.Matrix reportItemDef9 = (Microsoft.ReportingServices.ReportProcessing.Matrix)reportItemDef;
                MatrixInstance reportItemInstance9 = (MatrixInstance)reportItemInstance;
                reportItem = new Matrix(intUniqueName, reportItemDef9, reportItemInstance9, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Table)
            {
                Microsoft.ReportingServices.ReportProcessing.Table reportItemDef10 = (Microsoft.ReportingServices.ReportProcessing.Table)reportItemDef;
                TableInstance reportItemInstance10 = (TableInstance)reportItemInstance;
                reportItem = new Table(intUniqueName, reportItemDef10, reportItemInstance10, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.OWCChart)
            {
                Microsoft.ReportingServices.ReportProcessing.OWCChart reportItemDef11 = (Microsoft.ReportingServices.ReportProcessing.OWCChart)reportItemDef;
                OWCChartInstance reportItemInstance11 = (OWCChartInstance)reportItemInstance;
                reportItem = new OWCChart(intUniqueName, reportItemDef11, reportItemInstance11, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.Chart)
            {
                Microsoft.ReportingServices.ReportProcessing.Chart reportItemDef12 = (Microsoft.ReportingServices.ReportProcessing.Chart)reportItemDef;
                ChartInstance reportItemInstance12 = (ChartInstance)reportItemInstance;
                reportItem = new Chart(intUniqueName, reportItemDef12, reportItemInstance12, renderingContext);
            }
            else if (reportItemDef is Microsoft.ReportingServices.ReportProcessing.CustomReportItem)
            {
                Microsoft.ReportingServices.ReportProcessing.CustomReportItem reportItemDef13 = (Microsoft.ReportingServices.ReportProcessing.CustomReportItem)reportItemDef;
                CustomReportItemInstance reportItemInstance13 = (CustomReportItemInstance)reportItemInstance;
                reportItem = new CustomReportItem(uniqueName, intUniqueName, reportItemDef13, reportItemInstance13, renderingContext, childrenNonComputedUniqueNames);
                if (!renderingContext.NativeAllCRITypes && (renderingContext.NativeCRITypes == null || !renderingContext.NativeCRITypes.ContainsKey(((CustomReportItem)reportItem).Type)))
                {
                    reportItem = ((CustomReportItem)reportItem).AltReportItem;
                }
            }
            return(reportItem);
        }
示例#5
0
 internal Report(IDefinitionPath parentDefinitionPath, bool subreportInSubtotal, Microsoft.ReportingServices.ReportRendering.SubReport subReport, RenderingContext renderingContext)
 {
     m_parentDefinitionPath = parentDefinitionPath;
     m_renderReport         = subReport.Report;
     m_isOldSnapshot        = true;
     m_subreportInSubtotal  = subreportInSubtotal;
     if (m_renderReport != null)
     {
         m_name        = m_renderReport.Name;
         m_description = m_renderReport.Description;
     }
     m_renderingContext = new RenderingContext(renderingContext);
     m_pageEvaluation   = null;
 }