Rendering Reports housed in Reporting Service Server on your ASP.NET pages

Discussion in 'Databases' started by Bruce, May 30, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Used everything as suggested and report opens up fine. However, this report is getting opened on reportserver directly and not getting rendered in the rsweb:reportViewer control...

    any idea..?
     
  2. I am moving a system from servers here to DASP, and mostly things seem to work ... except I am confused by this issue.

    1. Are you saying that I need to insert code into the asp.net application for each reportviewer that runs in "remote" mode to set the credentials?

    2. When hosting the application ourselves we gave ASPNET browser priviledges on the reports folder and that was it. (maybe IUSR_ too). Why do I need to do something different here?

    3. Is there any other, less error-prone, way of incorporating remote reports into my asp.net application?

    Now a problem:

    I have implemented this in a test application and although it gets past the 401 error the report displays incorrectly - no data and some of the images in the report control bar are missing (see attachment).

    Now I'm really stuck - any help anyone?

    Thanks
    John
     

    Attached Files:

  3. Hi Bruce, I do have everything set up the way you specified in your guide, however I am still not able to access the reports from within my application using the report viewer. Everything works fine if I access the report server directly.

    Would you be able to help me out? Maybe look at the logs to see what is going on?

    I am getting the following error:
    The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.

    Thanks!
    Dmitry
     
  4. I have some reports uploaded and working. I'd like users to login into an entry page, then access the reports.

    I found the website8.zip example. I tried creating a project where I could refer to the ReportViewer control, but I got errors that the obect is not declared. I think I have the wrong type of project. What kind of project is website8? (website, right?) I am using the latest Visual Web Developer Express, SSRS 2005, SQL 2008

    Here is the code for my ReportEntry.aspx. The reference to ReportViewer1. has an error "Name 'ReportViewer1' is not declared". What kind of project should I create to call the reports using the IReportServerCredentials interface?

    Imports System.Net
    Imports System.Security.Principal
    Imports Microsoft.Reporting.WebForms

    Partial Class _ReportsEntry :
    Inherits System.Web.UI.Page

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials()
    End Sub

    End Class

    <Serializable()> _
    Public NotInheritable Class MyReportServerCredentials
    Implements IReportServerCredentials
    Public ReadOnly Property ImpersonationUser() As WindowsIdentity _
    Implements IReportServerCredentials.ImpersonationUser
    Get
    'Use the default windows user. Credentials will be
    'provided by the NetworkCredentials property.
    Return Nothing
    End Get
    End Property
    Public ReadOnly Property NetworkCredentials() As ICredentials _
    Implements IReportServerCredentials.NetworkCredentials
    Get
    'User name
    Dim userName As String = _
    ConfigurationManager.AppSettings("MyReportViewerUser")

    If (String.IsNullOrEmpty(userName)) Then
    Throw New Exception("Missing user name from web.config file")
    End If

    'Password
    Dim password As String = _
    ConfigurationManager.AppSettings("MyReportViewerPassword")

    If (String.IsNullOrEmpty(password)) Then
    Throw New Exception("Missing password from web.config file")
    End If

    'Domain
    Dim domain As String = _
    ConfigurationManager.AppSettings("MyReportViewerDomain")

    If (String.IsNullOrEmpty(domain)) Then
    Throw New Exception("Missing domain from web.config file")
    End If

    'Return New NetworkCredential(userName, password, domain)
    Return New NetworkCredential(userName, password, domain)
    End Get
    End Property
    Public Function GetFormsCredentials(ByRef authCookie As Cookie, ByRef userName As String, ByRef password As String, ByRef authority As String) As Boolean _
    Implements IReportServerCredentials.GetFormsCredentials
    authCookie = Nothing
    userName = Nothing
    password = Nothing
    authority = Nothing
    'Not using form credentials
    Return False
    End Function

    End Class
     
  5. I accept with code: <asp:ReportViewer BackColor="green" Width="800px" Height="800px" ID="ReportViewer1" runat="server" ProcessingMode="Remote">
    <ServerReport DisplayName="MyReport" ReportPath="/[DASP_UserName]/reports/Service Report" ReportServerUrl="https://rs2k501.discountasp.net/ReportServer" />
    </asp:ReportViewer>
     
  6. ReportViewer Path

    I have tried the advice given by bruce in is article. I seem to have gotten around the security issues by creating the example class that implements the IReportServerCredentials interface.

    However, when I run the reportviewer control i get this error message:

    The item '/etftradegur/reports/Report1.rdlc' cannot be found. (rsItemNotFound)

    Here is my .aspx code for the report viewer:

    <rsweb:ReportViewer ID="MembersReportViewer" runat="server" Font-Names="Verdana"
    Font-Size="8pt" Height="400px" Width="604px" ProcessingMode="Remote">
    <ServerReport ReportPath="/etftradegur/reports/Report1.rdlc"
    ReportServerUrl="https://rs2k501.discountasp.net/ReportServer" />
    <LocalReport>
    <DataSources>
    <rsweb:ReportDataSource DataSourceId="ObjectDataSource1"
    Name="MembersRemoteDataset_Members" />
    </DataSources>
    </LocalReport>
    </rsweb:ReportViewer>

    I have indeed uploaded the report to this location, as the RS Manager shows.

    The data source is set up to point to the remote database at DASP.

    Any ideas?
     
  7. Problem Solved

    The Tech Support staff at DASP solved this problem for me. In my case, the problem was that I developed the website in IIS 6, but deployed it to their server running IIS 7. For IIS 7, I had to put the following line of code into my web.config file, in the <system.Webserver> section:

    <add name="Reserved-ReportViewerWebControl-axd" path="Reserved.ReportViewerWebControl.axd"
    verb="*" type="Microsoft.Reporting.WebForms.HttpHandler" resourceType="Unspecified"
    />

    This let me host my report right on the webserver, without using the Reporting Services feature.

    Here is the link they gave me to an online post that describes the issue:

    http://otkfounder.blogspot.com/2007/11/solving-reportviewer-rendering-issue-on.html
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page