Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


HTML Rendering with charts


HTML Rendering with charts

Author
Message
CriticalRationalist
CriticalRationalist
Grasshopper
Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)

Group: General Forum Members
Points: 20 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
patrice.tremblay
patrice.tremblay
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search