public ReportPaginationInfo(AspNetCore.ReportingServices.OnDemandReportRendering.Report report, Version serverRPLVersion, double pageHeight)
        {
            bool flag = false;

            this.m_stream = report.GetOrCreateChunk(AspNetCore.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Pagination, "PaginationInfo", out flag);
            if (this.m_stream != null)
            {
                if (flag)
                {
                    this.m_version    = serverRPLVersion;
                    this.m_pageHeight = pageHeight;
                    this.SavePaginationInfo();
                    this.m_paginatedPages = 0;
                    this.m_metadataPages  = new List <long>();
                    this.m_reportDone     = false;
                }
                else if (this.ExtractPaginationInfo(serverRPLVersion))
                {
                    this.m_stream.Close();
                    this.m_stream     = report.CreateChunk(AspNetCore.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Pagination, "PaginationInfo");
                    this.m_version    = serverRPLVersion;
                    this.m_pageHeight = pageHeight;
                    this.SavePaginationInfo();
                    this.m_paginatedPages = 0;
                    this.m_metadataPages  = new List <long>();
                    this.m_reportDone     = false;
                }
                else if (pageHeight != this.m_pageHeight)
                {
                    this.m_stream         = null;
                    this.m_version        = new Version(0, 0, 0);
                    this.m_paginatedPages = -1;
                    this.m_offsetLastPage = -1L;
                    this.m_offsetHeader   = -1L;
                    this.m_pageHeight     = 0.0;
                    this.m_metadataPages  = null;
                    this.m_reportDone     = false;
                }
            }
        }
        private static Stream GetInteractivityChunck(AspNetCore.ReportingServices.OnDemandReportRendering.Report report, string chunkName, int page, out int lastPage)
        {
            lastPage = 0;
            Stream stream = null;
            bool   flag   = false;

            stream = ((page != 1) ? report.GetChunk(AspNetCore.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Interactivity, chunkName) : report.GetOrCreateChunk(AspNetCore.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Interactivity, chunkName, out flag));
            if (stream == null)
            {
                return(null);
            }
            if (!flag)
            {
                long num = stream.Length - 9;
                if (num > 0)
                {
                    stream.Seek(num, SeekOrigin.Begin);
                    BinaryReader binaryReader = new BinaryReader(stream);
                    binaryReader.ReadByte();
                    num = 9 + binaryReader.ReadInt64();
                    stream.Seek(-num, SeekOrigin.End);
                    binaryReader.ReadByte();
                    lastPage = binaryReader.ReadInt32();
                    if (binaryReader.ReadBoolean())
                    {
                        return(null);
                    }
                    stream.Seek(-num, SeekOrigin.End);
                }
                else
                {
                    stream.Seek(0L, SeekOrigin.Begin);
                }
            }
            return(stream);
        }