Reporting Services connection string

Discussion in 'Databases' started by NoBullMan, Jan 8, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,
    I have deployed my reports from my local VS 2005 to discountasp. When I try to tun the reports, I get a connection error. It seems the connction string for the datasource is incorrect. I used the connection string that is listed in SQL 2005 database manager:

    Data Source=tcp:sql2k511.discountasp.net;Initial Catalog=SQL2005_xxxxxx_dbname;User ID=SQL2005_xxxxxx_dbname_user;Password=abcd1234

    This generates:
    Cannot create a connection to data source 'timetracker'.
    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

    I tried to use the user id specified in the reporting services in the connection string, but no luck.

    What am i doing wrong?

    Thanks.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    are you getting this error when trying to run the report in the report viewer interface?


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Thanks for the reply Bruce. It turned out that when I deployed my reports from my local machine, I was still connecting using Windows Integrated security instead of the database credentials. That got resolved. Now, I can go to the report viewer on discountasp and I can see my reports.


    However, when I try to run the reports from the web application (a page with reportviewer control in it), it dies. The error is:
    <SUB>The specified module could not be found. (Exception from HRESULT: 0x8007007E)


    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

    Source Error:





    Code:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:





    Code:
    [FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
       System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0
       System.Management.ManagementScope.InitializeGuts(Object o) +873
       System.Management.ManagementScope.Initialize() +213
       System.Management.ManagementObjectSearcher.Initialize() +145
       System.Management.ManagementObjectSearcher.Get() +34
       Microsoft.ReportingServices.Diagnostics.WebUtil.GetIPAddresses(String machine) +273
       Microsoft.ReportingServices.Diagnostics.WebRequestUtil.get_LocalIPAddresses() +138
       Microsoft.ReportingServices.Diagnostics.WebRequestUtil.IsLocalIPAddress(String ipAddress) +37
       Microsoft.ReportingServices.Diagnostics.WebRequestUtil.IsClientLocal() +79
       Microsoft.Reporting.WebForms.ErrorControl.WriteStackTrace(HtmlTextWriter writer) +10
       Microsoft.Reporting.WebForms.ErrorControl.Render(HtmlTextWriter writer) +58
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       Microsoft.Reporting.WebForms.ReportViewer.Render(HtmlTextWriter writer) +293
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
       System.Web.UI.Control.Render(HtmlTextWriter writer) +7
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
       System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
       System.Web.UI.Control.Render(HtmlTextWriter writer) +7
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
       System.Web.UI.Page.Render(HtmlTextWriter writer) +26
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558
    
    This is the page that is supposed to display the report:



    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Report_ByProject_Time.aspx.cs" Inherits="TT_Report_ByProject_Time" Title="Untitled Page" %>


    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"


    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>


    <asp:Content ID="Content1" ContentPlaceHolderID="maincontent" Runat="Server">


    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" Height="400px" ProcessingMode="Remote" Width="400px">


    <ServerReport


    ReportPath="/timetracker/timebyprojects_timeperiod"


    ReportServerUrl=https://rs2k501.discountasp.net />


    </rsweb:ReportViewer>


    </asp:Content>
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    i think it may be a web server configuration issue. Please raise a support ticket in the control panel.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Thanks Bruce. It seems the error was caused by a system configuration and the admin folks at discountasp fixed it.

    However, when I try to open the reports from the page, for two of the three reports, I get:

    The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.

    • <LI style="DISPLAY: inline; FONT-WEIGHT: normal; FONT-SIZE: 8pt; FONT-FAMILY: Verdana">The request failed with HTTP status 404: Not Found.
    And for the third one:



    • <LI style="DISPLAY: inline; FONT-WEIGHT: normal; FONT-SIZE: 8pt; FONT-FAMILY: Verdana">The request failed with HTTP status 401: Unauthorized.
    All three reports are accessible through report manager, I don't believe I have to specify any credentials apart from the connection string in web.config, and I am able to access database tables from other pages in the projectthat display the data in the database.

    This is what I use in pages that display the report:




    <%@ Page Language="C#" MasterPageFile="~/TimeTracker/MasterPage.master" AutoEventWireup="true" CodeFile="Report_ByProject.aspx.cs" Inherits="TimeTracker_Report_ByProject" Title="Untitled Page" %>


    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"


    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>


    <asp:Content ID="Content1" ContentPlaceHolderID="maincontent" Runat="Server">


    <rsweb:ReportViewer ID="rvProjByProj" runat="server" ProcessingMode="Remote">


    <ServerReport ReportPath="/Time Tracker/TimeByProjects" />


    </rsweb:ReportViewer>


    </asp:Content>
     
  6. Bruce

    Bruce DiscountASP.NET Staff

  7. Bruce

    Bruce DiscountASP.NET Staff

    Basically.. by default, the report viewer control will use the ASPNET user credential to connect to the Reporting Service server and this will not work. With the code we posted, you basically tell Report Viewer control to use another credential.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  8. Hi


    I have got the same problem (401) with a report that I havedeployed to my Report Server. I tried to follow the link you (Bruce) provided, but I do understand the syntax of the code, that should deliver the "new" credentials to the RS. I tried to follow the MS implementation (http://msdn2.microsoft.com/en-US/library/microsoft.reporting.webforms.ireportservercredentials%20(VS.80).aspx) but still no luck. Do you have some example with aspx and cs files, that I can try? Perhaps you can try to explain the credentials thing to me one more time.


    Best regards, Jens Rauff
     
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