Unable to establish a connection to the database using Report Designer

4 posts, 1 answers
  1. Dadan
    Dadan avatar
    2 posts
    Member since:
    Feb 2010

    Posted 13 Jul 2014 Link to this post

    Dear Telerik Team,

    I have a problem.

    "An error has occurred while processing Report 'theReport':
    Unable to establish a connection to the database. Please, verify that
    your connection string is valid. In case you use a named connection
    string from the application configuration file, make sure the name is
    correct and the connection string settings are present in the
    configuration file of your application.
    "

    I'm
    1. Using Telerik Report Q2 2014
    2. Designing report using Report Designer (.TRDX)
    3. implementing report using ASP.NET v.4 (VB)
    4. confuse, it works when i click preview from report designer, but it wont work (saying the above error message) when running it using ASP.NET

    the code behind:
    Dim uriReportSource As New UriReportSource()
    uriReportSource.Uri = Server.MapPath("~/Report/") & "theReport.trdx"
    uriReportSource.Parameters.Add(New Telerik.Reporting.Parameter("ID", Request("ID")))
    ReportViewer1.ReportSource = uriReportSource


    The ConnectionString:
    1. in Report Designer/TRDX file, "MyCS"
    2. in Web.Config, "MyCS"
    3. the same connection string value and the same named connectionString.

    Can you help me with this? how can i run my report using asp.net.

    Thank you


  2. Answer
    Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 16 Jul 2014 Link to this post

    Hello Dadan,

    The provided code behind and configuration seems to be correct. Thus, it would be best if you could provide us with small runnable sample project exhibiting this behavior, so we can review it locally and advise accordingly.

    Additionally, you can try to hardcode the full connection string in the TRDX file instead of using a named connection string and test if the report can be displayed in the viewer with such configuration.

    Note that the Telerik Reporting 8.1.14.618 version had an issue with empty design time values for data source parameters, so we recommend you to upgrade to the latest internal build where this issue is fixed and verify if the problematic behavior persists. Please, download the latest internal build from your account and give it a try.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Jonathan
    Jonathan avatar
    1 posts
    Member since:
    Mar 2015

    Posted 02 Apr 2015 in reply to Nasko Link to this post

    I'm receiving a similar issue.

    I have an external database server.

    Using trdx with an asp.net mvc project.

    It appears that preview will work if I give it a design time parameter for the single parameter I'm passing.

    However, it won't actually load unless I change the connection string for the datasource (under the <SqlDataSource> node) to be the actual connection string.

    While this works, it means that I have to update this node parameter manually every time a change is made, and let others working on the reports either know about it (if they're sufficiently knowledgeable) or tell them to send it over to me every time to change the parameter.

    This isn't ideal.

    Has there been any progress on this front since July 2014?

  4. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 03 Apr 2015 Link to this post

    Hello Jonathan,

    The issue reported in this forum thread has been fixed in the Q2 2014 SP1 (8.1.14.804) Telerik Reporting release.

    In case the issue is still present on your end after upgrading to the latest version, please provide us with a sample report exhibiting it, so we can investigate further.

    As for using different connection strings for design-time and run-time we recommend using a named connection string which will be retrieved from the application configuration file. For more information, please refer to the Connection Strings and Configuration Files MSDN article.

    Regards,
    Nasko
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top