public int ProcessBookmarkNavigationEvent(Microsoft.ReportingServices.OnDemandReportRendering.Report report, int totalPages, string bookmarkId, out string uniqueName)
        {
            uniqueName = null;
            if (!report.HasBookmarks)
            {
                return(0);
            }
            if (bookmarkId == null)
            {
                return(0);
            }
            int  lastPageCollected = 0;
            bool reportDone        = false;
            int  num = InteractivityChunks.FindBoomark(report, bookmarkId, ref uniqueName, ref lastPageCollected, ref reportDone);

            if (!reportDone && num == 0)
            {
                using (SPBProcessing sPBProcessing = new SPBProcessing(report, totalPages, needTotalPages: true))
                {
                    sPBProcessing.CanTracePagination = true;
                    sPBProcessing.SetContext(new SPBContext(0, 0, addToggledItems: true));
                    return(sPBProcessing.FindBookmark(bookmarkId, lastPageCollected, ref uniqueName));
                }
            }
            return(num);
        }
Пример #2
0
 internal void Process(Microsoft.ReportingServices.OnDemandReportRendering.Report report, OnDemandProcessingContext odpContext, bool generateDocumentMap, bool createSnapshot)
 {
     m_odpContext     = odpContext;
     m_report         = report;
     m_generateDocMap = (generateDocumentMap && m_report.HasDocumentMap);
     m_createSnapshot = createSnapshot;
     if (m_generateDocMap)
     {
         odpContext.HasRenderFormatDependencyInDocumentMap = false;
     }
     if (m_generateDocMap || m_createSnapshot)
     {
         foreach (Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection in report.ReportSections)
         {
             Visit(reportSection);
         }
     }
     if (m_generateDocMap && m_docMapWriter != null)
     {
         m_docMapWriter.WriteEndContainer();
         m_docMapWriter.Close();
         m_docMapWriter = null;
         if (odpContext.HasRenderFormatDependencyInDocumentMap)
         {
             odpContext.OdpMetadata.ReportSnapshot.SetRenderFormatDependencyInDocumentMap(odpContext);
         }
     }
 }
        public int ProcessDocumentMapNavigationEvent(Microsoft.ReportingServices.OnDemandReportRendering.Report report, string documentMapId)
        {
            if (!report.HasDocumentMap)
            {
                return(0);
            }
            if (documentMapId == null)
            {
                return(0);
            }
            int  lastPageCollected = 0;
            bool reportDone        = false;
            int  num = InteractivityChunks.FindDocumentMapLabel(report, documentMapId, ref lastPageCollected, ref reportDone);

            if (!reportDone && num == 0)
            {
                using (SPBProcessing sPBProcessing = new SPBProcessing(report, 0, needTotalPages: false))
                {
                    sPBProcessing.CanTracePagination = true;
                    sPBProcessing.SetContext(new SPBContext(0, 0, addToggledItems: true));
                    return(sPBProcessing.FindDocumentMap(documentMapId, lastPageCollected));
                }
            }
            return(num);
        }
Пример #4
0
		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);
			}
		}
Пример #5
0
        protected override bool InternalRender(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
        {
            NameValueCollection deviceInfo2 = ResolveDeviceInfo(deviceInfo);

            clientCapabilities.Remove(BrowserDetectionUtility.JavaScriptKey);
            MHTMLStreamManager mHTMLStreamManager = new MHTMLStreamManager(createAndRegisterStream);

            try
            {
                bool flag   = CheckForHtmlOnlyDeviceInfo(deviceInfo2);
                bool result = base.InternalRender(report, reportServerParameters, deviceInfo2, clientCapabilities, ref renderProperties, flag ? createAndRegisterStream : new CreateAndRegisterStream(mHTMLStreamManager.CreateStream));
                if (flag)
                {
                    return(result);
                }
                MHTMLStreamManager.MHTMLStream mHTMLStream = (MHTMLStreamManager.MHTMLStream)mHTMLStreamManager.m_streams[0];
                Stream      stream      = createAndRegisterStream(mHTMLStream.m_name, "mhtml", new ASCIIEncoding(), "multipart/related", willSeek: false, StreamOper.CreateAndRegister);
                MhtmlWriter mhtmlWriter = new MhtmlWriter();
                mhtmlWriter.StartMimeDocument(stream);
                foreach (MHTMLStreamManager.MHTMLStream stream2 in mHTMLStreamManager.m_streams)
                {
                    mhtmlWriter.WriteMimeBodyPart(stream2.m_stream, stream2.m_name, stream2.mimeType, stream2.encoding);
                }
                mhtmlWriter.EndMimeDocument();
                stream.Flush();
                return(result);
            }
            finally
            {
                mHTMLStreamManager.CloseAllStreams();
            }
        }
 internal void SetParameters(Html5ServerRenderer sr, DeviceInfo deviceInfo, Microsoft.ReportingServices.OnDemandReportRendering.Report report)
 {
     if (!deviceInfo.HTMLFragment && report.Parameters != null)
     {
         sr.Parameters = report.Parameters;
     }
 }
 internal ItemContext(RPLWriter rplWriter, PageContext pageContext, Microsoft.ReportingServices.OnDemandReportRendering.Report report, Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection)
 {
     RPLWriter     = rplWriter;
     PageContext   = pageContext;
     Report        = report;
     ReportSection = reportSection;
 }
Пример #8
0
 public PaginationSettings(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection aDeviceInfo)
 {
     Init(report);
     ParseDeviceInfo(aDeviceInfo, out int columns, out double columnSpacing);
     ValidateFields(columns, columnSpacing);
     m_dynamicImageDpiX = m_dpiX;
     m_dynamicImageDpiY = m_dpiY;
 }
Пример #9
0
 internal override void WriteCustomNonSharedItemProps(RPLElementProps nonSharedProps, RPLWriter rplWriter, PageContext pageContext)
 {
     Microsoft.ReportingServices.OnDemandReportRendering.Report report = ((Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source).Report;
     if (report != null && report.Language != null)
     {
         string text = null;
         text = ((!report.Language.IsExpression) ? report.Language.Value : report.Instance.Language);
         ((RPLSubReportProps)nonSharedProps).Language = text;
     }
 }
Пример #10
0
        internal static Bookmarks GetBookmarksStream(Microsoft.ReportingServices.OnDemandReportRendering.Report report, int page)
        {
            int    lastPage            = 0;
            Stream interactivityChunck = GetInteractivityChunck(report, "Bookmarks", page, out lastPage);

            if (interactivityChunck != null)
            {
                return(new Bookmarks(interactivityChunck, lastPage));
            }
            return(null);
        }
Пример #11
0
        internal static string GetReportLanguage(Microsoft.ReportingServices.OnDemandReportRendering.Report report)
        {
            string result = null;
            ReportStringProperty language = report.Language;

            if (language != null)
            {
                result = ((!language.IsExpression) ? language.Value : report.Instance.Language);
            }
            return(result);
        }
Пример #12
0
        internal static DocumentMapLabels GetLabelsStream(Microsoft.ReportingServices.OnDemandReportRendering.Report report, int page)
        {
            int    lastPage            = 0;
            Stream interactivityChunck = GetInteractivityChunck(report, "Labels", page, out lastPage);

            if (interactivityChunck != null)
            {
                return(new DocumentMapLabels(interactivityChunck, lastPage));
            }
            return(null);
        }
Пример #13
0
 internal override void WriteCustomNonSharedItemProps(RPLElementProps nonSharedProps, PageContext pageContext)
 {
     Microsoft.ReportingServices.OnDemandReportRendering.Report report = ((Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source).Report;
     if (report != null)
     {
         string reportLanguage = Report.GetReportLanguage(report);
         if (reportLanguage != null)
         {
             ((RPLSubReportProps)nonSharedProps).Language = reportLanguage;
         }
     }
 }
Пример #14
0
 internal override void WriteCustomNonSharedItemProps(BinaryWriter spbifWriter, PageContext pageContext)
 {
     Microsoft.ReportingServices.OnDemandReportRendering.Report report = ((Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source).Report;
     if (report != null)
     {
         string reportLanguage = Report.GetReportLanguage(report);
         if (reportLanguage != null)
         {
             spbifWriter.Write((byte)11);
             spbifWriter.Write(reportLanguage);
         }
     }
 }
Пример #15
0
        internal override ServerRenderer CreateRenderer(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParams, DeviceInfo deviceInfo, NameValueCollection rawDeviceInfo, NameValueCollection browserCaps, CreateAndRegisterStream createAndRegisterStreamCallback, ref Hashtable renderProperties, int totalPages)
        {
            Dictionary <string, string> globalBookmarks = Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing.CollectBookmarks(report, totalPages);

            Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing spbProcessing = new Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing(report, createAndRegisterStreamCallback, registerEvents: false, ref renderProperties);
            SecondaryStreams secondaryStreams = SecondaryStreams.Temporary;
            ServerRenderer   serverRenderer   = new MHTMLRenderer(new ROMReport(report), spbProcessing, reportServerParams, deviceInfo, rawDeviceInfo, browserCaps, createAndRegisterStreamCallback, secondaryStreams);

            serverRenderer.InitializeReport();
            SetParameters(serverRenderer, deviceInfo, report);
            serverRenderer.GlobalBookmarks = globalBookmarks;
            return(serverRenderer);
        }
Пример #16
0
 internal override void WriteCustomNonSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext)
 {
     Microsoft.ReportingServices.OnDemandReportRendering.Report report = ((Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source).Report;
     if (report != null && report.Language != null)
     {
         string text = null;
         text = ((!report.Language.IsExpression) ? report.Language.Value : report.Instance.Language);
         if (text != null)
         {
             spbifWriter.Write((byte)11);
             spbifWriter.Write(text);
         }
     }
 }
        public int ProcessFindStringEvent(Microsoft.ReportingServices.OnDemandReportRendering.Report report, int totalPages, int startPage, int endPage, string findValue)
        {
            if (findValue == null || startPage <= 0 || endPage <= 0)
            {
                return(0);
            }
            int num = 0;

            using (SPBProcessing sPBProcessing = new SPBProcessing(report, totalPages, needTotalPages: true))
            {
                sPBProcessing.CanTracePagination = true;
                sPBProcessing.SetContext(new SPBContext(0, 0, addToggledItems: false));
                return(sPBProcessing.FindString(startPage, endPage, findValue));
            }
        }
        public int ProcessUserSortEvent(Microsoft.ReportingServices.OnDemandReportRendering.Report report, string textbox, ref int numberOfPages, ref PaginationMode paginationMode)
        {
            if (textbox == null)
            {
                return(0);
            }
            int num = 0;

            using (SPBProcessing sPBProcessing = new SPBProcessing(report, 0, needTotalPages: false))
            {
                sPBProcessing.CanTracePagination = true;
                sPBProcessing.SetContext(new SPBContext(0, 0, addToggledItems: true));
                return(sPBProcessing.FindUserSort(textbox, ref numberOfPages, ref paginationMode));
            }
        }
        public string ProcessDrillthroughEvent(Microsoft.ReportingServices.OnDemandReportRendering.Report report, int totalPages, string drillthroughId, out NameValueCollection parameters)
        {
            parameters = null;
            if (drillthroughId == null)
            {
                return(null);
            }
            int    lastPageCollected = 0;
            string text = null;

            using (SPBProcessing sPBProcessing = new SPBProcessing(report, totalPages, needTotalPages: true))
            {
                sPBProcessing.CanTracePagination = true;
                sPBProcessing.SetContext(new SPBContext(0, 0, addToggledItems: true));
                return(sPBProcessing.FindDrillthrough(drillthroughId, lastPageCollected, out parameters));
            }
        }
        internal virtual Html5ServerRenderer CreateRenderer(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParams, DeviceInfo deviceInfo, NameValueCollection rawDeviceInfo, NameValueCollection browserCaps, CreateAndRegisterStream createAndRegisterStreamCallback, ref Hashtable renderProperties, int totalPages)
        {
            Dictionary <string, string> globalBookmarks = new Dictionary <string, string>();

            if (!deviceInfo.HasActionScript && (deviceInfo.Section == 0 || !deviceInfo.AllowScript))
            {
                globalBookmarks = Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing.CollectBookmarks(report, totalPages);
            }
            Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing spbProcessing = new Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing(report, createAndRegisterStreamCallback, registerEvents: true, ref renderProperties);
            SecondaryStreams    secondaryStreams    = SecondaryStreams.Embedded;
            Html5ServerRenderer html5ServerRenderer = new Html5ServerRenderer(new ROMReport(report), spbProcessing, reportServerParams, deviceInfo, rawDeviceInfo, browserCaps, createAndRegisterStreamCallback, secondaryStreams);

            html5ServerRenderer.InitializeReport();
            SetParameters(html5ServerRenderer, deviceInfo, report);
            html5ServerRenderer.GlobalBookmarks = globalBookmarks;
            return(html5ServerRenderer);
        }
Пример #21
0
 private void VisitSubReport(Microsoft.ReportingServices.OnDemandReportRendering.SubReport subreportDef)
 {
     if (subreportDef.Report == null || subreportDef.Instance == null || subreportDef.ProcessedWithError)
     {
         return;
     }
     Microsoft.ReportingServices.OnDemandReportRendering.Report report = subreportDef.Report;
     if (!report.HasDocumentMap && !m_createSnapshot)
     {
         return;
     }
     foreach (Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection in report.ReportSections)
     {
         Visit(reportSection.Body.ReportItemCollection);
         VisitStyle(reportSection.Body.Style);
     }
 }
        private static ReportItem FindReportItem(Microsoft.ReportingServices.OnDemandReportRendering.Report report, IEnumerable <string> reportItemPathSteps, out Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection)
        {
            reportSection = null;
            int num = reportItemPathSteps.Count();

            if (num == 0)
            {
                return(null);
            }
            bool       flag       = num > 1;
            string     text       = reportItemPathSteps.FirstOrDefault();
            ReportItem reportItem = null;

            foreach (Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection2 in report.ReportSections)
            {
                foreach (ReportItem item in reportSection2.Body.ReportItemCollection)
                {
                    if (flag)
                    {
                        Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = item as Microsoft.ReportingServices.OnDemandReportRendering.SubReport;
                        if (subReport != null && subReport.Report != null && string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = FindReportItem(subReport.Report, reportItemPathSteps.Skip(1), out reportSection);
                        }
                    }
                    else
                    {
                        Microsoft.ReportingServices.OnDemandReportRendering.Rectangle rectangle = item as Microsoft.ReportingServices.OnDemandReportRendering.Rectangle;
                        if (rectangle != null)
                        {
                            reportItem = FindReportItem(rectangle, text);
                        }
                        else if (string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = item;
                        }
                    }
                    if (reportItem != null)
                    {
                        reportSection = reportSection2;
                        return(reportItem);
                    }
                }
            }
            return(null);
        }
Пример #23
0
        private void Init(Microsoft.ReportingServices.OnDemandReportRendering.Report report)
        {
            Page page = report.ReportSections[0].Page;

            PageHeightStr = page.PageHeight.ToString();
            PageWidthStr  = page.PageWidth.ToString();
            MarginTop     = page.TopMargin.ToMillimeters();
            MarginLeft    = page.LeftMargin.ToMillimeters();
            MarginBottom  = page.BottomMargin.ToMillimeters();
            MarginRight   = page.RightMargin.ToMillimeters();
            int count = report.ReportSections.Count;

            m_sectionPaginationSettings = new SectionPaginationSettings[count];
            for (int i = 0; i < count; i++)
            {
                m_sectionPaginationSettings[i] = new SectionPaginationSettings(report.ReportSections[i]);
            }
        }
Пример #24
0
 public bool Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
 {
     try
     {
         ParseDeviceInfo(ref deviceInfo);
         Render(report, deviceInfo, renderProperties, createAndRegisterStream);
         return(true);
     }
     catch (ReportRenderingException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         throw new ReportRenderingException(ex2, unexpected: true);
     }
 }
Пример #25
0
        internal ReportPaginationInfo(Microsoft.ReportingServices.OnDemandReportRendering.Report report, Version serverRPLVersion, double pageHeight)
        {
            bool isNewChunk = false;

            m_stream = report.GetOrCreateChunk(Microsoft.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Pagination, "PaginationInfo", out isNewChunk);
            if (m_stream != null)
            {
                if (isNewChunk)
                {
                    m_version    = serverRPLVersion;
                    m_pageHeight = pageHeight;
                    SavePaginationInfo();
                    m_paginatedPages = 0;
                    m_metadataPages  = new List <long>();
                    m_reportDone     = false;
                }
                else if (ExtractPaginationInfo(serverRPLVersion))
                {
                    m_stream.Close();
                    m_stream     = report.CreateChunk(Microsoft.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Pagination, "PaginationInfo");
                    m_version    = serverRPLVersion;
                    m_pageHeight = pageHeight;
                    SavePaginationInfo();
                    m_paginatedPages = 0;
                    m_metadataPages  = new List <long>();
                    m_reportDone     = false;
                }
                else if (pageHeight != m_pageHeight)
                {
                    m_stream         = null;
                    m_version        = new Version(0, 0, 0);
                    m_paginatedPages = -1;
                    m_offsetLastPage = -1L;
                    m_offsetHeader   = -1L;
                    m_pageHeight     = 0.0;
                    m_metadataPages  = null;
                    m_reportDone     = false;
                }
            }
        }
Пример #26
0
 public bool RenderStream(string streamName, Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
 {
     try
     {
         deviceInfo             = ((deviceInfo == null) ? new NameValueCollection() : deviceInfo);
         reportServerParameters = ((reportServerParameters == null) ? new NameValueCollection() : reportServerParameters);
         clientCapabilities     = ((clientCapabilities == null) ? new NameValueCollection() : clientCapabilities);
         return(InternalRenderStream(streamName, report, reportServerParameters, deviceInfo, clientCapabilities, ref renderProperties, createAndRegisterStream));
     }
     catch (ReportRenderingException)
     {
         throw;
     }
     catch (Exception ex2)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(ex2))
         {
             throw;
         }
         throw new ReportRenderingException(ex2, unexpected: true);
     }
 }
Пример #27
0
        internal static int FindBoomark(Microsoft.ReportingServices.OnDemandReportRendering.Report report, string bookmarkId, ref string uniqueName, ref int lastPageCollected, ref bool reportDone)
        {
            int    result = 0;
            string text   = null;
            Stream chunk  = report.GetChunk(Microsoft.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Interactivity, "Bookmarks");

            if (chunk != null && chunk.Length > 0)
            {
                chunk.Position = 0L;
                BinaryReader binaryReader = new BinaryReader(chunk);
                byte         b            = binaryReader.ReadByte();
                while (true)
                {
                    switch (b)
                    {
                    case 0:
                        text = binaryReader.ReadString();
                        if (SPBProcessing.CompareWithOrdinalComparison(bookmarkId, text, ignoreCase: false) != 0)
                        {
                            goto IL_0059;
                        }
                        uniqueName = binaryReader.ReadString();
                        return(binaryReader.ReadInt32());

                    case 2:
                        lastPageCollected = binaryReader.ReadInt32();
                        reportDone        = binaryReader.ReadBoolean();
                        break;
                    }
                    break;
IL_0059:
                    binaryReader.ReadString();
                    binaryReader.ReadInt32();
                    binaryReader.ReadByte();
                    b = binaryReader.ReadByte();
                }
            }
            return(result);
        }
Пример #28
0
		public bool RenderStream(string streamName, Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
		{
			try
			{
				if (string.IsNullOrEmpty(streamName))
				{
					return false;
				}
				return Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing.RenderSecondaryStream(report, createAndRegisterStream, streamName);
			}
			catch (ReportRenderingException)
			{
				throw;
			}
			catch (Exception ex2)
			{
				if (AsynchronousExceptionDetection.IsStoppingException(ex2))
				{
					throw;
				}
				throw new ReportRenderingException(ex2, unexpected: true);
			}
		}
Пример #29
0
 private void Init(Microsoft.ReportingServices.OnDemandReportRendering.Report report, PaginationSettings pagination, CreateAndRegisterStream createAndRegisterStream, ref Hashtable renderProperties)
 {
     m_pageContext             = new PageContext(pagination, report.AddToCurrentPage, report.ConsumeContainerWhitespace, createAndRegisterStream);
     m_paginationSettings      = pagination;
     m_report                  = new Report(report, m_pageContext, pagination);
     m_createAndRegisterStream = createAndRegisterStream;
     if (report.SnapshotPageSizeInfo != Microsoft.ReportingServices.OnDemandReportRendering.Report.SnapshotPageSize.Large)
     {
         m_createStream = false;
     }
     if (!string.IsNullOrEmpty(pagination.ReportItemPath))
     {
         m_pageContext.Common.IsInSelectiveRendering = true;
         m_selectiveRendering = new SelectiveRendering(report, m_pageContext, pagination);
     }
     else
     {
         if (m_totalPages > 0)
         {
             return;
         }
         m_totalPages = 0;
         if (report.NeedsOverallTotalPages | report.NeedsPageBreakTotalPages)
         {
             m_pageContext.Common.PauseDiagnostics();
             SetContext(0, 0);
             m_pageContext.PropertyCacheState = PageContext.CacheState.CountPages;
             while (NextPage())
             {
             }
             m_totalPages = m_pageContext.PageNumber;
             m_pageContext.Common.UpdateTotalPagesRegionMapping();
             m_pageContext.Common.ResumeDiagnostics();
             m_pageContext.TextBoxDuplicates = null;
         }
     }
 }
        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);
                    }
                }
            }
        }