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

How to set a connection to the web page for an autonomous report

1 Answer 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paulo Rogério
Top achievements
Rank 1
Paulo Rogério asked on 17 Aug 2016, 12:58 PM


I created the report by Telerik Report Design where he consumes a database view and displays the report. Opening the file and clicking preview the report appears.

When I call the web page connection error report.

As I seto the connection to the SQL DataSource through my linking controller with my data sources que with are my command que is in the report?

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 18 Aug 2016, 09:15 AM
Hello Paulo,

If you used a SqlDataSource component, please check the value of the SqlDataSource.ConnectionString property - it must be the name of the connection string or a hard-coded connection string.

If you saved the connection string by name, in the project that displays the report add an entry with that name under connectionStrings e.g.:
             //report
            //
            // sqlDataSource1
            //
            this.sqlDataSource1.ConnectionString = "Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString";
            this.sqlDataSource1.Name = "sqlDataSource1";
            this.sqlDataSource1.Parameters.AddRange(new Telerik.Reporting.SqlDataSourceParameter[] {
            new Telerik.Reporting.SqlDataSourceParameter("@cultureID", System.Data.DbType.String, "=Parameters(\'CultureID\').Value")});
            this.sqlDataSource1.SelectCommand = resources.GetString("sqlDataSource1.SelectCommand");
 
 
 
<!-- web.config -->
 <connectionStrings>
    <add name="Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString"
              connectionString="Data Source=(local)\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=SSPI"
              providerName="System.Data.SqlClient" />
    <add name="AdventureWorks"
    connectionString="Data Source=.\mssqlserver2014;Initial Catalog=AdventureWorks;Integrated Security=SSPI"
    providerName="System.Data.SqlClient" />
  </connectionStrings>



Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Paulo Rogério
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or