コード例 #1
0
        public byte[] RenderStream(string format, string deviceInfo, string streamID, out string mimeType)
        {
            if (this.m_executionSession.Snapshot != null)
            {
                Stream chunk = ((SnapshotBase)this.m_executionSession.Snapshot).GetChunk(streamID, ReportProcessing.ReportChunkTypes.StaticImage, out mimeType);
                if (chunk == null)
                {
                    chunk = ((SnapshotBase)this.m_executionSession.Snapshot).GetChunk(streamID, ReportProcessing.ReportChunkTypes.Image, out mimeType);
                }
                if (chunk != null)
                {
                    byte[] array = new byte[chunk.Length];
                    chunk.Read(array, 0, (int)chunk.Length);
                    return(array);
                }
            }
            using (StreamCache streamCache = new StreamCache())
            {
                this.m_itemContext.RSRequestParameters.SetRenderingParameters(deviceInfo);
                ReportProcessing    reportProcessing = this.CreateAndConfigureReportProcessing();
                IRenderingExtension newRenderer      = this.CreateRenderer(format, true);
                AspNetCore.ReportingServices.ReportProcessing.RenderingContext rc = this.CreateRenderingContext();
                ProcessingContext        pc     = this.CreateProcessingContext(streamCache.StreamCallback);
                OnDemandProcessingResult result = reportProcessing.RenderSnapshotStream(newRenderer, streamID, rc, pc);
                this.m_executionSession.SaveProcessingResult(result);

                string text2 = default(string);
                return(streamCache.GetMainStream(out Encoding text, out mimeType, out text2));
            }
        }
コード例 #2
0
 public void MoveSecondaryStreamsTo(StreamCache other)
 {
     foreach (KeyValuePair <string, CachedStream> secondaryStream in this.m_secondaryStreams)
     {
         other.m_secondaryStreams.Add(secondaryStream.Key, secondaryStream.Value);
     }
     this.m_secondaryStreams.Clear();
 }