all groups > sql server reporting services > april 2005 >
You're in the

sql server reporting services

group:

RENDERSTREAM - What am I doing wrong?


RENDERSTREAM - What am I doing wrong? IraD
4/6/2005 1:45:02 PM
sql server reporting services:
I'm writing my own app that calls the RS Web Service.
So far, pretty good, but I can't seem to make RENDERSTREAM Work.

Do you have any idea what is wrong with this code?
The error I get is that RenderStream can not find the stream....

RenderedReport = myReportService.Render
(myReport, Format, HistoryID, DeviceInfo, myParameters, Credentials,
ShowHideToggle, Encoding, MimeType, UsedParameters, Warnings, StreamIDs)

For Each streamid As String In StreamIDs

RenderedStreams = myReportService.RenderStream _
(myReport, Format, streamid, Nothing, Nothing, Nothing,
Nothing, Nothing)

My DEVINFO for the RENDER is

DeviceInfo = "<DeviceInfo>"
DeviceInfo += "<HTMLFragment>True</HTMLFragment>"
DeviceInfo += "<Parameters>False</Parameters>"
DeviceInfo += "<Toolbar>False</Toolbar>"
DeviceInfo += "<StreamRoot>/" + Session("RSFolder") +
"/resources/</StreamRoot>"
DeviceInfo += "</DeviceInfo>"

Re: RENDERSTREAM - What am I doing wrong? Frank Matthiesen
4/7/2005 12:00:00 AM
[quoted text, click to view]

Ira..

Try this:
Dim result As Byte() = Nothing
Dim image As Byte()

result = rs.Render(path, format, historyID, deviceInfo, parameters, Nothing,
Nothing, encoding, _
mimeType, parametersUsed, warnings, streamIds)


Select Case format
Case "HTML4.0", "HTML3.2"
' render stream for each image and save to disk
Dim stream As System.IO.FileStream
For Each streamid As String In streamIds
Dim encodingImage As String
Dim mimeTypeImage As String
image = rs.RenderStream(path, format, streamid, Nothing, Nothing,
parameters, encodingImage, mimeTypeImage)
stream = System.IO.File.OpenWrite(Server.MapPath("./Temp") & "\" &
streamid)
stream.Write(image, 0, CInt(image.Length))
stream.Close()
Next

Dim enc As System.Text.Encoding = System.Text.Encoding.UTF8
ReportPlaceholder.InnerHtml = enc.GetString(result)

Case Else
Response.ClearContent()
Response.AppendHeader("content-length", result.Length.ToString())
Response.ContentType = mimeType
Response.BinaryWrite(result)
Response.Flush()
Response.Close()
End Select

Re: RENDERSTREAM - What am I doing wrong? IraD
4/7/2005 8:11:04 AM
Frank,

Much closer. My error was that I did not pass the "parameters" argument
correctly to RENDERSTREAM. I had NOTHING, now that I have sent along the
parameters, renderstream works.

But I don't understand the reportplaceholder.innerhtml statement. What I
now see on my screen is a box that looks like it wants to hold my chart - but
it doesn't have it. Do I have to send the results of renderstream to the
response object as well as the results of the render?

Thanks.

[quoted text, click to view]
Re: RENDERSTREAM - What am I doing wrong? Frank Matthiesen
4/7/2005 6:08:03 PM
[quoted text, click to view]


PlaceHolder is declared on aspx-page
Send me your mail-adress...i will send you the files with full code.


regards

Frank

RE: RENDERSTREAM - What am I doing wrong? IraD
4/8/2005 7:01:08 AM
Much appreciated: IDOBROW@AIB.ORG

[quoted text, click to view]
AddThis Social Bookmark Button