Example #1
0
 bool Microsoft.ReportingServices.OnDemandReportRendering.IRenderingExtension.RenderStream(string streamName, Microsoft.ReportingServices.OnDemandReportRendering.Report report, System.Collections.Specialized.NameValueCollection reportServerParameters, System.Collections.Specialized.NameValueCollection deviceInfo, System.Collections.Specialized.NameValueCollection clientCapabilities, ref System.Collections.Hashtable renderProperties, Microsoft.ReportingServices.Interfaces.CreateAndRegisterStream createAndRegisterStream)
 {
     // throw new System.NotImplementedException();
     return(false);
 }
Example #2
0
        bool Microsoft.ReportingServices.OnDemandReportRendering.IRenderingExtension.Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report
                                                                                            , System.Collections.Specialized.NameValueCollection reportServerParameters, System.Collections.Specialized.NameValueCollection deviceInfo
                                                                                            , System.Collections.Specialized.NameValueCollection clientCapabilities, ref System.Collections.Hashtable renderProperties
                                                                                            , Microsoft.ReportingServices.Interfaces.CreateAndRegisterStream createAndRegisterStream)
        {
            // throw new System.NotImplementedException();

            //Call the render method of the intermediate rendering extension
            //pdfRenderer.Render(report, reportServerParameters, deviceInfo, clientCapabilities, ref renderProperties, new Microsoft.ReportingServices.Interfaces.CreateAndRegisterStream(IntermediateCreateAndRegisterStream));

            //Register stream for new rendering extension
            System.IO.Stream outputStream = createAndRegisterStream(_name, _extension, _encoding, _mimeType, _willSeek, _operation);

            intermediateStream.Position = 0;

            //put stream update code here


            //Copy the stream to the outout stream
            byte[] buffer = new byte[32768];
            while (true)
            {
                int read = intermediateStream.Read(buffer, 0, buffer.Length);
                if (read <= 0)
                {
                    break;
                }
                outputStream.Write(buffer, 0, read);
            }
            buffer = null;

            intermediateStream.Close();

            return(false);
        }