Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

HTML Rendering with charts Expand / Collapse
Author
Message
Posted Thursday, January 24, 2008 1:38 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, May 25, 2011 6:58 AM
Points: 16, Visits: 70
Hi,

I want to load reports through the webservices. (I don't use the reportviewer component for reasons of how the way my ajax was setup and client site caching.) But when I render this as pure HTML, I only get the HTML and not the graphs. This seems logical. I read that I had to process the images 1 by 1 with RenderStream. But when I write them out to the response I end up with only the last image. Here I write the images to disk, but then I should find a way to update the URLs in the report.
Isn't there any more convenient way to do this?


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rs As New ReportingService

rs.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim results As Byte(), image As Byte()
Dim streamids As String(), streamid As String


' Render the report to HTML4.0
results = rs.Render("/SampleReports/Product Line Sales", "HTML4.0", _
Nothing, " ", Nothing, _
Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, streamids)

' For each image stream returned by the call to render,
' render the stream and save it to the application root
For Each streamid In streamids
image = rs.RenderStream("/SampleReports/Product Line Sales", "HTML4.0", streamid, _
Nothing, Nothing, Nothing, Nothing, Nothing)

Dim stream As System.IO.FileStream = _
System.IO.File.OpenWrite("C:\Inetpub\wwwroot\WebApplication1\" & streamid)

stream.Write(image, 0, CInt(image.Length))
stream.Close()
Next
' Write the rendered report to the Web form
Response.BinaryWrite(results)

End Sub

thanks,
Jan
Post #446779
Posted Thursday, December 15, 2011 6:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, December 15, 2011 5:55 AM
Points: 1, Visits: 1
You can control the location of the images in the rendered html by setting the StreamRoot element of the DeviceInfo XML parameter.
Post #1222340
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse