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

2 posts, 0 answers
  1. Paulo Rogério
    Paulo Rogério avatar
    4 posts
    Member since:
    May 2014

    Posted 17 Aug Link to this post



    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?
  2. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 18 Aug Link to this post

    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
  3. DevCraft banner
Back to Top