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

Error while previewing MySQL Datasource

1 Answer 426 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Jinad
Top achievements
Rank 1
Jinad asked on 04 Apr 2020, 05:41 AM

Hi,

    I was trying to create a new data source with MySQL connection string in Telerik Report Designer Standalone tool. While trying to preview the datasource results on clicking 'Execute Query' button I am getting an error message "An error has occurred.
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.
"  When tried to connect with SQL server connection string, I am able to view the results.

   Then I set the same MySQL connection string as shared connection and was able to create and run a report using the Telerik Report Designer. But when tried to execute the same report from Angular report viewer using Telerik Rest service, I'm getting the same error mentioned above. It would be helpful if anybody can provide a solution for this issue. Please find attached files to get more details about the error.

Thanks.

 

 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 08 Apr 2020, 02:47 PM

Hi Jinad,

If I understood correctly, initially you received the errors shown in the attached screenshots when trying to configure a SqlDataSource in the Standalone designer's Data Source Wizard. When you set up the connection string as shared in the configuration file of the designer, the data was successfully previewed.

Can you enable the Trace Listener in the Standalone designer and try to reproduce the issue? You may check the Standalone Report Designer Problems article for instructions. Then you may send us the generated log file for investigation.

Concerning the REST Service project, there is no data provider name specified in the registration of the connection string as seen from the additional image. In this case, the Reporting engine will use the default SqlCllient data provider - How To: Host Reports Service In ASP.NET Core 2.1 and 2.2. For the default data provider, the connection string is not valid and results in the observed error. you may use the following connection string syntax in the 'appsettings.json':

{
  ...
  "ConnectionStrings": {
    "ReportConnection": {
      "connectionString": "Server=103.6.12.159;Port=6003;Database=...;Uid=root;Pwd=...;",
      "providerName": "MySql.Data.MySqlClient"
    }
  }
}

If the problem persists after correcting the connection string, we will need more details. You may send us the Trace Listener log from the REST Service project - check Troubleshooting reporting implementation into ASP.NET Core application.

You may also send us a runnable project, including the database (or a sample one that may be used to reproduce the issue) for local inspection.

Regards,
Todor
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Report Designer (standalone)
Asked by
Jinad
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or