This is a migrated thread and some comments may be shown as answers.

Unable to establish a connection

1 Answer 131 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Najid Hanif
Top achievements
Rank 2
Najid Hanif asked on 30 Mar 2013, 03:22 AM
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;

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
IvanY
Telerik team
answered on 01 Apr 2013, 10:27 AM
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.

Greetings,
IvanY
the Telerik team

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

Tags
Report Designer (standalone)
Asked by
Najid Hanif
Top achievements
Rank 2
Answers by
IvanY
Telerik team
Share this question
or