public bool Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable someProps, CreateAndRegisterStream createAndRegisterStream)
        {
            double pageHeight = double.MaxValue;

            using (Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing sPBProcessing = new Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing(report, createAndRegisterStream, pageHeight))
            {
                DeviceInfo deviceInfo2 = new DeviceInfo(deviceInfo);
                SPBContext sPBContext  = new SPBContext();
                sPBContext.StartPage                = 0;
                sPBContext.EndPage                  = 0;
                sPBContext.MeasureItems             = false;
                sPBContext.AddSecondaryStreamNames  = true;
                sPBContext.AddToggledItems          = deviceInfo2.ExpandToggles;
                sPBContext.AddFirstPageHeaderFooter = true;
                sPBProcessing.SetContext(sPBContext);
                using (IWordWriter writer = NewWordWriter())
                {
                    WordRenderer wordRenderer = NewWordRenderer(createAndRegisterStream, deviceInfo2, sPBProcessing, writer, report.Name);
                    try
                    {
                        return(wordRenderer.Render());
                    }
                    catch (ReportRenderingException)
                    {
                        throw;
                    }
                    catch (Exception ex2)
                    {
                        if (AsynchronousExceptionDetection.IsStoppingException(ex2))
                        {
                            throw;
                        }
                        throw new ReportRenderingException(ex2, unexpected: true);
                    }
                }
            }
        }
 public void SetContext(SPBContext spbContext)
 {
     this.m_spbContext = spbContext;
 }
 public bool Render(AspNetCore.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
 {
     try
     {
         this.ParseDeviceinfo(deviceInfo);
         Stream     output     = this.CreateFinalOutputStream(report.Name, createAndRegisterStream);
         MainEngine mainEngine = new MainEngine(createAndRegisterStream, this);
         if (report.HasDocumentMap && !this.m_omitDocumentMap)
         {
             this.m_addedDocMap = mainEngine.AddDocumentMap(report.DocumentMap);
             if (this.m_addedDocMap)
             {
                 mainEngine.NextPage();
             }
         }
         using (AspNetCore.ReportingServices.Rendering.SPBProcessing.SPBProcessing sPBProcessing = new AspNetCore.ReportingServices.Rendering.SPBProcessing.SPBProcessing(report, createAndRegisterStream, 1.7976931348623157E+308))
         {
             SPBContext sPBContext = new SPBContext();
             sPBContext.StartPage               = 0;
             sPBContext.EndPage                 = 0;
             sPBContext.MeasureItems            = false;
             sPBContext.AddSecondaryStreamNames = true;
             sPBContext.AddToggledItems         = true;
             sPBContext.AddOriginalValue        = true;
             sPBProcessing.SetContext(sPBContext);
             RPLReport rPLReport = null;
             bool      flag      = true;
             while (!sPBProcessing.Done)
             {
                 sPBProcessing.GetNextPage(out rPLReport);
                 if (rPLReport != null)
                 {
                     if (flag)
                     {
                         flag = false;
                         if (sPBProcessing.Done)
                         {
                             mainEngine.AdjustFirstWorksheetName(report.Name, this.m_addedDocMap);
                         }
                     }
                     else
                     {
                         mainEngine.NextPage();
                     }
                     mainEngine.RenderRPLPage(rPLReport, !this.m_simplePageHeaders, this.m_suppressOutlines);
                     rPLReport.Release();
                     rPLReport = null;
                 }
             }
             mainEngine.Save(output);
         }
         if (report.JobContext != null)
         {
             IJobContext jobContext = report.JobContext;
             lock (jobContext.SyncRoot)
             {
                 if (jobContext.AdditionalInfo.ScalabilityTime == null)
                 {
                     jobContext.AdditionalInfo.ScalabilityTime = new ScaleTimeCategory();
                 }
                 jobContext.AdditionalInfo.ScalabilityTime.Rendering = mainEngine.TotalScaleTimeMs;
                 if (jobContext.AdditionalInfo.EstimatedMemoryUsageKB == null)
                 {
                     jobContext.AdditionalInfo.EstimatedMemoryUsageKB = new EstimatedMemoryUsageKBCategory();
                 }
                 jobContext.AdditionalInfo.EstimatedMemoryUsageKB.Rendering = mainEngine.PeakMemoryUsageKB;
             }
         }
         mainEngine.Dispose();
         return(false);
     }
     catch (ReportRenderingException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         throw new ReportRenderingException(ex2, true);
     }
 }