all groups > sql server reporting services > june 2004 >
You're in the

sql server reporting services

group:

SOAP render works with charts for me now, but...


SOAP render works with charts for me now, but... Roland
6/27/2004 8:02:24 PM
sql server reporting services: .... how to get rid of additional authentication boxes?

The scene:

I succeeded to render a report via SOAP API _including_ all charts and
images. That is not primarily my result; I just mixed some of the advises
and postings of this group concerning the topic "Render reports with charts"
together and made it run.

I'm now able to call the SOAP API for a given report in order to get the
report rendered with all the charts correctly to an ASPX page.

One problem remains: During the rendering process, where my
RenderReport.aspx is loaded a couple of times, sometimes the Windows
authentication box of my webserver pops up and requests the credentials.

Is there a chance to get rid of this? I already provided the creds as you
can see in row 5

Any pointer welcome

roland

BTW: Pls. find attached the working code (as I said: NOT owned and NOT (c)
by myself :) You'll find a couple of familiar lines throughout the forums. I
just made it run for me. Pls. replace the obvious placebos with your values)



' RenderReport.aspx

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim rs As ReportingService = New ReportingService
rs.Credentials = New System.Net.NetworkCredential("username", "password",
"domain")
rs.PreAuthenticate = True
' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = "/reportpath/reportname"
Dim format As String = "HTML4.0"
Dim parameters() As ParameterValue = Nothing
Dim credentials() As DataSourceCredentials = Nothing
Dim streamIDs As String() = Nothing
If (CStr(Request.QueryString("SessionId")) = "") Then
Try
Dim devInfo As String =
"<DeviceInfo><Toolbar>False</Toolbar><StreamRoot>./RenderReport.aspx?Session
Id={SessionId}&amp;StreamId=</StreamRoot></DeviceInfo>"
result = rs.Render(reportPath, format, Nothing, devInfo, parameters,
Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, streamIDs)
Catch ex As Exception
HttpContext.Current.Response.Write("<HTML><BODY><H1>Error</H1><br><br>" &
ex.Message & "</BODY></HTML>")
Response.End()
End Try
Response.Clear()
Response.Write(New
System.Text.UTF7Encoding().GetString(result).Replace("{SessionId}",
rs.SessionHeaderValue.SessionId))
Else
Try
Dim devInfo As String =
"<DeviceInfo><OutputFormat>JPEG</OutputFormat></DeviceInfo>"
rs.SessionHeaderValue = New SessionHeader
rs.SessionHeaderValue.SessionId = CStr(Request.QueryString("SessionId"))
rs.SessionHeaderValue.IsNewExecution = False
result = rs.RenderStream(reportPath, format,
CStr(Request.QueryString("StreamId")), Nothing, devInfo, parameters,
Nothing, Nothing)
Catch ex As Exception
HttpContext.Current.Response.Write("<HTML><BODY><H1>Error</H1><br><br>" &
ex.Message & "</BODY></HTML>")
Response.End()
End Try
Response.Clear()
Response.ContentType = "image/JPEG"
Response.BinaryWrite(result)
End If
rs.Dispose()
End Sub


Re: SOAP render works with charts for me now, but... Roland
6/27/2004 10:47:33 PM
[quoted text, click to view]

Response.Write(New
System.Text.UTF8Encoding().GetString(result).Replace("{SessionId}",
rs.SessionHeaderValue.SessionId))
is better :)

roland



AddThis Social Bookmark Button