Esempio n. 1
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);
        }
Esempio n. 2
0
        private static Stream GetInteractivityChunck(Microsoft.ReportingServices.OnDemandReportRendering.Report report, string chunkName, int page, out int lastPage)
        {
            lastPage = 0;
            Stream stream     = null;
            bool   isNewChunk = false;

            stream = ((page != 1) ? report.GetChunk(Microsoft.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Interactivity, chunkName) : report.GetOrCreateChunk(Microsoft.ReportingServices.OnDemandReportRendering.Report.ChunkTypes.Interactivity, chunkName, out isNewChunk));
            if (stream == null)
            {
                return(null);
            }
            if (!isNewChunk)
            {
                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);
        }