Unable to establish a connection

2 posts, 1 answers
  1. Najid Hanif
    Najid Hanif avatar
    92 posts
    Member since:
    Jul 2011

    Posted 29 Mar 2013 Link to this post

    Hi I have created my report with the stand alone report designer. When I preview it in the report designer it works just fine. But when I try and load it on an aspx page I get errors on the page (See attached ) where ever I have a SQL connection. Is the connection string in the trdx file? Or am I supposed to define that someplace else?

    Telerik.Reporting.UriReportSource uriReportSource = new Telerik.Reporting.UriReportSource();
          string reportpath = System.Web.HttpContext.Current.Server.MapPath("~") + "/trdx/EAM_Report.trdx";
          uriReportSource.Uri = reportpath;
          ReportViewer1.ReportSource = uriReportSource;

  2. Answer
    IvanY avatar
    417 posts

    Posted 01 Apr 2013 Link to this post

    Hi Andy,

    Up to your question: you will need to define the connection string in the web.config as well. Since most probably you are using named connection strings all you have to do is copy that connection string and give it the same name as in the designer. Also please note that you can set the value of the connection string to be different from the one in your designer - that way you can use a fake/design time database while you are designing your reports and the actual production database when you deploy them.

    I hope that helps.

    the Telerik team

    Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

  3. DevCraft R3 2016 release webinar banner
Back to Top