Reporting services Credentials Xpert Help need

Discussion in 'ASP .Net' started by Phils, Nov 30, 2006.

  1. Phils

    Phils Guest

    Hello guys;


    i have just found the solution to my problem but would like to full
    the solution so would be great full if you could enlighten me.

    OUR Set-up

    Server A = <WEBSERVER>
    SERVER B = <SQLServer & ReportingServer>

    Both in workgroups(but on the same domain) behind firewall.

    user logs into website, request a client report.

    connection made to webserver <Server A>
    webserver quiers Reporting Server <Server B>
    Reporting Server quiers SQLServer <Server B>

    Report Displayed in client browser

    Topic A:
    Web.config file on Server A
    <identity impersonate="true" userName="userX"

    Q) am i right in thinking with this setting in your web.config file you
    will be
    impersonating userX that has been setup on Server B and assigned the
    proper rights.

    Topic B:
    Passing credential as opposed to impersonating userX

    (Using form authentication to log users in - checking against user
    table in database)

    Q) Basically the user will select a report, once this selection is made
    the parameter collection is queried to
    get the required parameters for the report using this collection the
    appropriate control values are
    taken from the controls on the web page. to make system more secure i
    would prefer to pass the credentials from within the
    code. from my reading i figured that i have to

    1) create a credentialcache and populate with user info i.e.


    Dim report As String = strReportPath & strReportName
    Dim forRendering As Boolean = False
    Dim historyID As String = Nothing
    Dim values As webServ.ParameterValue() = Nothing
    Dim credentials As webServ.DataSourceCredentials() =
    Dim parameters As webServ.ReportParameter() = Nothing

    'Create an instance of the CredentialCache class.
    Dim cache As Net.CredentialCache = New

    'Add a NetworkCredential instance to CredentialCache.
    'Negotiate for NTLM or Kerberos authentication.
    cache.Add(New Uri(rs.Url), "Negotiate", New
    Net.NetworkCredential("userX", "userXPassword", "domain"))

    rs.PreAuthenticate =True
    'Assign CredentialCache to the Web service Client
    Proxy(myProxy) Credetials property.
    rs.Credentials = cache

    ' get parameter
    parameters = rs.GetReportParameters(report, historyID,
    forRendering, values, credentials)

    2) create a credential class that implements
    'Microsoft.Reporting.WebForms' = (ReportVererCredentials) i.e


    dim clsObj as New ReportVererCredentials("userX",
    "userXPassword", "domain")

    ReportViewer1.ServerReport.ReportServerCredentials =

    I cant understand why i have to pass the credential twice in two
    different ways. but if i don't i get an "401 error access denied"
    as i said this code now works but im not sure if im am doing things
    correctly can you advise.

    Topic C

    I have a test web server that i use to run the website and it works
    fine on that but when i move the same code to
    my Main web server i get an error on the line

    dim clsObj as New ReportVererCredentials("userX", "userXPassword",

    COMPLIE ERROR MESSAGE: BC30002 Type 'ReportVererCredentials' is not

    any ideas what this is, am i declaring the class
    'ReportVererCredentials' properly

    Imports System.Web
    Imports System.Web.Services
    Imports System.Web.Services.Protocols

    Public Class UserObj

    Private Shared intID As Integer

    Public Shared Property ID() As Integer
    Return intID
    End Get
    Set(ByVal value As Integer)
    intID = value
    End Set
    End Property

    Private Shared strUserName As String
    Public Shared Property UserName() As String
    Return strUserName
    End Get
    Set(ByVal value As String)
    strUserName = value
    End Set
    End Property

    Private Shared intPermission As Integer
    Public Shared Property Permission() As Integer
    Return intPermission
    End Get
    Set(ByVal value As Integer)
    intPermission = value
    End Set
    End Property

    Private Shared intClientID As Integer
    Public Shared Property ClientID() As Integer
    Return intClientID
    End Get
    Set(ByVal value As Integer)
    intClientID = value
    End Set
    End Property

    Private Shared intEnabled As Integer
    Public Shared Property Enabled() As Integer
    Return intEnabled
    End Get
    Set(ByVal value As Integer)
    intEnabled = value
    End Set
    End Property

    End Class

    i also have the

    <add assembly="Microsoft.ReportViewer.WebForms, Version=,
    Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

    in the web.config file

    a lot I know but your help most appreciated

    Phils, Nov 30, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raju
  2. Pierre Vigneras
    Andrew Hobbs
    Jan 24, 2004
  3. Patrick

    frames question for xpert

    Patrick, Feb 16, 2005, in forum: HTML
    Feb 17, 2005
  4. wawa_piggy

    credentials for .net calling java web services

    wawa_piggy, Apr 21, 2004, in forum: ASP .Net Web Services
    Jan Tielens
    Apr 22, 2004
  5. Kelly Elias

    Multiple Web Services and Credentials

    Kelly Elias, Jan 19, 2005, in forum: ASP .Net Web Services
    Dilip Krishnan
    Jan 21, 2005

Share This Page