Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when calling renderstream in reporting services 2008 webservice

In my app I have a chart that is stored in Reporting Services, there is a method called 'RenderStream' which is called but it gives the following error:

"System.Web.Services.Protocols.SoapException was unhandled by user code Message="System.Web.Services.Protocols.SoapException: The selected report is not ready for viewing. The report is still being

rendered or a report snapshot is not available. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ReportNotReadyException: The

selected report is not ready for viewing. The report is still being rendered or a report snapshot is not available.\n at

Microsoft.ReportingServices.WebServer.ReportExecution2005Impl.RenderStream(String Format, String StreamID, String DeviceInfo, Byte[]&

Result, String& Encoding, String& MimeType)\n at Microsoft.ReportingServices.WebServer.ReportExecutionService.RenderStream(String

Format, String StreamID, String DeviceInfo, Byte[]& Result, String& Encoding, String& MimeType)"

Has anyone come across this error before?

Many thanks in advance, Chris.

like image 798
Chris Avatar asked Nov 06 '22 17:11

Chris


1 Answers

Due to very limited documentation around the usage of RenderStream(), I was receiving this error, but I found a resolution. RenderStream() requires a StreamId to pass to it. You receive an array of those id's from the Render() method. Hence, you must call Render() prior to calling RenderStream(). Additionally, Render() returns an ExecutionId in the ExecutionHeader. This ID must be passed in the RenderStream() method, also wrapped in an ExecutionHeader object. Once I did that, the error went away and the report generated the image I was looking for. Hope this helps someone out there.

like image 139
tbehunin Avatar answered Nov 14 '22 20:11

tbehunin