public bool Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream) { try { ParseParameters(deviceInfo); Stream outputStream = createAndRegisterStream(report.Name, "rpl", null, "application/octet-stream", willSeek: false, StreamOper.CreateAndRegister); Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing sPBProcessing = null; using (sPBProcessing = new Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing(report, createAndRegisterStream, registerEvents: true, m_rplVersion, ref renderProperties)) { sPBProcessing.SetContext(m_spbContext); sPBProcessing.GetNextPage(outputStream); sPBProcessing.UpdateRenderProperties(ref renderProperties); } return false; } catch (ReportRenderingException) { throw; } catch (Exception ex2) { if (AsynchronousExceptionDetection.IsStoppingException(ex2)) { throw; } throw new ReportRenderingException(ex2, unexpected: true); } }
public bool Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream) { try { ParseDeviceinfo(deviceInfo); Stream output = CreateFinalOutputStream(report.Name, createAndRegisterStream); MainEngine mainEngine = new MainEngine(createAndRegisterStream, this); if (report.HasDocumentMap && !m_omitDocumentMap) { m_addedDocMap = mainEngine.AddDocumentMap(report.DocumentMap); if (m_addedDocMap) { mainEngine.NextPage(); } } using (Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing sPBProcessing = new Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing(report, createAndRegisterStream, double.MaxValue)) { 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) { continue; } if (flag) { flag = false; if (sPBProcessing.Done) { mainEngine.AdjustFirstWorksheetName(report.Name, m_addedDocMap); } } else { mainEngine.NextPage(); } mainEngine.RenderRPLPage(rplReport, !m_simplePageHeaders, 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, unexpected: true); } }