Use different sql data source in report based on parameters

0 Answers 45 Views
.NET Core DataSource SQL Report Designer (standalone) Report Parameters
Kenneth
Top achievements
Rank 2
Iron
Kenneth asked on 05 Jun 2022, 04:37 PM

I am using the stand alone report designer with embedded connection string. Works fine.

I have a QA database and a Prod database, based on a QA bit report parameter I would like to use one or the other in the report, is that possible?

If not I believe I will need two identical reports, one QA one Prod with only a different connecting string.

I also know I can have the connection string external and presumably set it to what I want prior to loading the report file in a customer report resolver, but would that mean I cannot preview the reports in the stand alone designer (since there will be no embedded connection string)?

Neli
Telerik team
commented on 07 Jun 2022, 12:27 PM

Hi Kenneth,

In the Change Connection String dynamically through a report parameter KB, we have demonstrated how to set the ConnectionString property only, assuming that the database is of the same type, hence the data provider will not change. 

One important note is that the above approach does not work for Report Parameter AvailableValues as the parameters are processed very early in the workflow, before the Expressions processing. I didn't see any indication that the report parameters have AvailableValues coming from a database and if so I strongly recommend using the above approach.

There is also one more approach which you can check Action NavigateToReport does not work after updating the Connection String dynamically in a Custom Report Resolver KB.

 

No answers yet. Maybe you can help?

Tags
.NET Core DataSource SQL Report Designer (standalone) Report Parameters
Asked by
Kenneth
Top achievements
Rank 2
Iron
Share this question
or