Ejemplo n.º 1
0
        public static bool InitializeSubReport(AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport subReport)
        {
            bool result = false;
            OnDemandProcessingContext onDemandProcessingContext = null;

            try
            {
                onDemandProcessingContext = subReport.OdpContext;
                Merge merge = new Merge(subReport.Report, onDemandProcessingContext);
                result = merge.InitAndSetupSubReport(subReport);
                if (onDemandProcessingContext.ErrorContext.Messages != null)
                {
                    if (0 < onDemandProcessingContext.ErrorContext.Messages.Count)
                    {
                        OnDemandProcessingContext topLevelContext = onDemandProcessingContext.TopLevelContext;
                        topLevelContext.ErrorContext.Register(ProcessingErrorCode.rsWarningExecutingSubreport, Severity.Warning, subReport.ObjectType, subReport.Name, null, onDemandProcessingContext.ErrorContext.Messages);
                        return(result);
                    }
                    return(result);
                }
                return(result);
            }
            catch (Exception e)
            {
                AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.HandleSubReportProcessingError(onDemandProcessingContext.TopLevelContext.ErrorContext, subReport, InstancePathItem.GenerateInstancePathString(subReport.InstancePath), onDemandProcessingContext.ErrorContext, e);
                return(result);
            }
        }
Ejemplo n.º 2
0
 public static bool InitializeSubReports(AspNetCore.ReportingServices.ReportIntermediateFormat.Report report, AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, OnDemandProcessingContext odpContext, bool inDataRegion, bool fromCreateSubReportInstance)
 {
     try
     {
         odpContext.IsTopLevelSubReportProcessing = true;
         bool flag = true;
         OnDemandProcessingContext onDemandProcessingContext = odpContext;
         foreach (AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport subReport in report.SubReports)
         {
             if (subReport.ExceededMaxLevel)
             {
                 return(flag);
             }
             IReference <AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference = null;
             try
             {
                 bool flag2 = false;
                 if (subReport.RetrievalStatus != AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport.Status.DefinitionRetrieveFailed)
                 {
                     onDemandProcessingContext = SubReportInitializer.InitializeSubReport(odpContext, subReport, reportInstance, inDataRegion || subReport.InDataRegion, fromCreateSubReportInstance, out flag2);
                     if (!inDataRegion && !subReport.InDataRegion && (!odpContext.SnapshotProcessing || odpContext.ReprocessSnapshot))
                     {
                         reference = subReport.CurrentSubReportInstance;
                     }
                 }
                 if (flag2 && subReport.Report.HasSubReports)
                 {
                     flag &= SubReportInitializer.InitializeSubReports(subReport.Report, (subReport.CurrentSubReportInstance != null) ? subReport.CurrentSubReportInstance.Value().ReportInstance.Value() : null, onDemandProcessingContext, inDataRegion || subReport.InDataRegion, fromCreateSubReportInstance);
                 }
                 if (onDemandProcessingContext.ErrorContext.Messages != null && 0 < onDemandProcessingContext.ErrorContext.Messages.Count)
                 {
                     OnDemandProcessingContext topLevelContext = odpContext.TopLevelContext;
                     topLevelContext.ErrorContext.Register(ProcessingErrorCode.rsWarningExecutingSubreport, Severity.Warning, subReport.ObjectType, subReport.Name, null, onDemandProcessingContext.ErrorContext.Messages);
                 }
                 flag &= flag2;
             }
             catch (Exception e)
             {
                 flag = false;
                 AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.HandleSubReportProcessingError(onDemandProcessingContext.TopLevelContext.ErrorContext, subReport, InstancePathItem.GenerateInstancePathString(subReport.InstancePath), onDemandProcessingContext.ErrorContext, e);
             }
             finally
             {
                 if (reference != null)
                 {
                     reference.Value().InstanceComplete();
                 }
             }
         }
         return(flag);
     }
     finally
     {
         odpContext.IsTopLevelSubReportProcessing = false;
     }
 }