I have created a web app that uses the reporting services Web Service to pull reports from the SQL Server.
The web server is on one machine, SQL Server on another and I use the web service to get the reports. I do not use URLs in any way in order to keep as much information hidden as possible.
I have been able to list all reports, select a report, get back the parameters required, set the parameter values and render reports using ReportingService.Render
HOWEVER...
The reports that work do not include charts (graphics). When I render a report using my app, if it has no chart I can view it in HTML, PDF, TIF, Excel and MHTML. If it has a chart then for PDF, Excel and TIF all is fine. If I try to use HTML or MHTML I get a big empty space where my charts should be.
In reading the BOL under ReportingService.Render Method
I found this: "StreamIds
[out] The stream identifiers. These IDs are passed to the RenderStream method. You can use them to render the external resources (images, etc.) that are associated with a given report. "
I have found this topic:
ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_ref_soapapi_service_lz_49f6.htm
ReportingService.RenderStream Method
I read the code, and I have tried to implement it as in the BOL. I am able to write the images onto the web-server hard-drive, and the image place holder properties no longer point to my SQL server (which they did at first) but I still don't get an image.
For example, my image is actually at:
http://sandy.murdocks.on.ca/1/reports/temp/C_79_S
It is there and it works. Now my report opens in a new window since I do the final call to open it like this:
Response.AddHeader("Content-Disposition", "attachment; filename=" & fileName)
Response.BinaryWrite(data)
When I right click on the image place holder I get this:
file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Temporary%20Internet%20Files/Content.IE5/QPIH2VE9/1/Reports/Temp/C_79_S
The images don't seem to get from being written on the drive, to being picked up for display.
My code for writing the images looks like this:
If format = "HTML4.0" Then
For Each streamid In streamIDs
image = rs.RenderStream(strpath, "HTML4.0", streamid, Nothing, Nothing, parameters, Nothing, Nothing)
Dim stream As System.IO.FileStream = _
System.IO.File.OpenWrite(Application("TempReports" ) & streamid)
stream.Write(image, 0, CInt(image.Length))
stream.Close()
Next
End If
Sandy Murdock MCP