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}&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
[quoted text, click to view] Roland wrote: > System.Text.UTF7Encoding().GetString(result).Replace("{SessionId}",
Response.Write(New System.Text.UTF8Encoding().GetString(result).Replace("{SessionId}", rs.SessionHeaderValue.SessionId)) is better :) roland
Don't see what you're looking for? Try a search.
|