Issue with Dynamic Connection Change in Telerik HTML5 Report Viewer and Report Designer

1 Answer 13 Views
.NET Core .NET Framework Report Viewer - HTML5 Report Viewer - HTML5 WebForms Report Viewer - MVC
jhonatan
Top achievements
Rank 1
jhonatan asked on 25 Apr 2025, 03:39 PM

Hi everyone,

I'm having an issue with Telerik Report Viewer (HTML5 version) and Telerik Report Designer. I'm trying to change the database connection dynamically, and although the new connection string is being passed correctly (I’ve confirmed this by printing the in-memory values), the report viewer keeps using the initial connection and doesn't apply the new one.

What's even stranger is that after clearing cookies, browser data, and restarting the site, it still sticks to the first connection it received. It feels like Telerik stores this connection internally (maybe through caching or some static variable) and won’t allow it to update.

Has anyone experienced something similar or knows how to force the viewer to use the new connection?
Any suggestions or guidance would be greatly appreciated.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Ivet
Telerik team
answered on 30 Apr 2025, 09:13 AM

Hello Jhonatan,

Thank you for reaching out.

You can check the name of the connection string in the SqlDataSource components, as it should be the same as in appsettings.json.

Ensure that the name of the connection selected in the SqlDataSource component matches the name of the connection defined in the ConnectionStrings property in the appsettings.json file and that the correct configuration file is loaded in the application.

Note that you also have the option of embedding the connection string in the report definition(see the second option in the above image) if you do need to change the connection string for the different environments.

If you want to make changes, you can get a Telerik.Reporting.Report instance and update all DataSource properties of data items in it. Please consider the example in Changing the connection string dynamically according to runtime data.

If that doesn't help, could you please send me a Trace log and a Fiddler? Also, it would be helpful if you could send me your Program.cs and appsettings.json, and if you could take a picture of your SqlDataSource setup.

I hope the provided information will help resolve the issue. Let us know if you have further questions.

Regards,
Ivet
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

jhonatan
Top achievements
Rank 1
commented on 30 Apr 2025, 08:25 PM

Thanks,
but that's not the issue. I handle it in the following way:

The problem happens when I pass a dynamic connection. For example, I manage multiple connections, and when I switch connections, the system gets stuck on the first one. It's very strange because it should switch connections without a problem.

It doesn't even change correctly after clearing cookies and browser data. Even when I open another browser to test the second connection, it still shows data from the first one. It's as if Telerik Report caches or "sticks" to the initial connection. It's really strange.






Tags
.NET Core .NET Framework Report Viewer - HTML5 Report Viewer - HTML5 WebForms Report Viewer - MVC
Asked by
jhonatan
Top achievements
Rank 1
Answers by
Ivet
Telerik team
Share this question
or