Deploying an .apsx page with ReportViewer Control to the DASP FTP site.

Discussion in 'ASP.NET 2.0' started by Bruce, Jan 3, 2008.

  1. Bruce

    Bruce DiscountASP.NET Staff

  2. I was wondering if anybody could help me with an issue i have when i am deploying my web page to the DASP ftp site?

    I have created an .aspx page (using Visual Web Developer 2005)that includes a ReportViewer control, I have managed to get a version working on my local machine (using the F5 function of Visual Web Developer) but as soon as i upload my .aspx page to the ftp site i recieve the error "
    <LI style="DISPLAY: inline; FONT-WEIGHT: normal; FONT-SIZE: 8pt; FONT-FAMILY: Verdana">The request failed with HTTP status 401: Unauthorized."
    I understand thatthis maybe due to the definitions of the userName, Password and Domain.

    I have reviewed many of the forums help topics (mainly http://community.discountasp.net/default.aspx?f=16&amp;m=17808)regarding this area but am unsure as to where and how the sample code is supposed to be applied within this situation. Could anyoneoutline the <tags> where i am supposed to be inserting theUser Credentials information (e.g. <script></script>)

    Does anyone have an annotated scripts (.aspx page and web.config)thatis available to post hereso that i could use this as an working example?

    Here is my .aspx page as it stands at the moment:

    <%@ Page Language="VB" %>



    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    <script runat="server">








    <Serializable()> _


    Public NotInheritable Class MyReportServerCredentials


    Implements IReportServerCredentials


    Public ReadOnly Property ImpersonationUser() As System.Security.Principal.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 Net.ICredentials _


    Implements IReportServerCredentials.NetworkCredentials


    Get


    Return New Net.NetworkCredential("MY USERNAME", "MY PASSWORD", "MY DOMAIN https://rs2k501.discountasp.net")


    End Get


    End Property


    Public Function GetFormsCredentials(ByRef authCookie As Net.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 True


    End Function


    End Class





    ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials()





    </script>


    <html xmlns="http://www.w3.org/1999/xhtml" enableviewstate="true" >


    <head runat="server">


    <title>Football Statistics Website</title>


    </head>





    <form id="form1" runat="server">


    <div style="text-align: center">


    <table>


    <tr>


    <td colspan="2" style="width: 864px; text-align: left">


    <strong><span style="font-size: 24pt; color: skyblue; font-family: Verdana; text-decoration: underline">Football Statistics</span></strong></td>


    <td style="width: 100px; color: #000000;">


    </td>


    </tr>


    <tr style="color: #000000">


    <td style="width: 125px; height: 5px">


    </td>


    <td colspan="2" rowspan="1" style="width: 864px; height: 5px; text-align: center">


    </td>


    </tr>


    <tr style="color: #000000">


    <td style="height: 7px;" bgcolor="crimson" bordercolordark="crimson" bordercolorlight="crimson" colspan="3">


    </td>


    </tr>


    <tr style="color: #000000">


    <td style="width: 125px; height: 5px; text-align: left">


    </td>


    <td colspan="2" rowspan="1" style="width: 864px; height: 5px; text-align: center">


    </td>


    </tr>


    <tr style="color: #000000">


    <td style="height: 10px; width: 125px; text-align: left;">


    <span style="border-top-width: 1px; border-left-width: 1px; font-size: 10pt; border-left-color: black;


    border-bottom-width: 1px; border-bottom-color: black; border-top-color: black;


    font-family: Verdana; border-right-width: 1px; border-right-color: black; color: Black;">


    <strong style="padding-left: 5px">Home</strong></span></td>


    <td colspan="2" rowspan="5" style="width: 864px; text-align: center">


    <rsweb:ReportViewer ID="ReportViewer1" runat="server" BackColor="SkyBlue" BorderColor="DodgerBlue"


    BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt" Height="740px"


    ProcessingMode="Remote" ShowFindControls="False" ShowPrintButton="False" ShowPromptAreaButton="False" Width="1050px" DocumentMapWidth="20%" Font-Underline="False" LinkDisabledColor="DimGray" ShowPageNavigationControls="False" SizeToReportContent="True" ShowBackButton="True">


    <ServerReport ReportPath="/direportsco/reports/League_Position_for_All_Seasons" ReportServerUrl="https://rs2k501.discountasp.net/reportserver"/>


    </rsweb:ReportViewer>


    </td>


    </tr>


    <tr style="color: #000000">


    <td style="height: 10px; width: 125px; text-align: left;">


    <strong><span style="font-size: 10pt; font-family: Verdana; padding-left: 5px; color: Black;">


    Free Bets</span></strong></td>


    </tr>


    <tr style="color: #000000">


    <td style="height: 10px; width: 125px; text-align: left;">


    <span style="font-size: 10pt; color: Black; font-family: Verdana"><strong style="padding-left: 5px">


    Match Statistics</strong></span></td>


    </tr>


    <tr style="color: #000000">


    <td style="height: 10px; width: 125px; text-align: left;">


    </td>


    </tr>


    <tr style="color: #000000">


    <td style="height: 567px; width: 125px;">


    </td>


    </tr>


    </table>


    </div>


    </form>


    </body>


    </html>


    Any help regarding this topic would be greatly appreciated


    Mark
     
  3. Your Code looks fine but it seems the problem is still with the line in your 'MyReportServerCredentials' class.I still suggest you to check your credentials (both username /password)

    Return New Net.NetworkCredential('MY USERNAME', 'MY PASSWORD', 'MY DOMAIN https://rs2k501.discountasp.net')

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. Hi there thanks for your reply

    Yes i have added all of the relevant usernames and passwords that apply to my access to the Reporting Services server.

    I think the problem is with where i am supposed to be inserting the following line of code:

    ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials()

    Please could you assist?

    Thanks

    Mark
     

Share This Page