As per the online documentation http://www.telerik.com/help/reporting/ui-edit-bindings.html, DataSource is a valid property path.
I tried binding it to the literal name of my datasource (instead of parameter or expression) but still doesn't work.
<
Bindings
>
<
Binding
Path
=
"DataSource"
Expression
=
"MySQLSourceName"
/>
</
Bindings
>
Has anyone tried this before and can confirm that it worked?
Thanks!
7 Answers, 1 is accepted
The binding you have set is not valid, but is logically equivalent to setting the report's DataSource property to the SqlDataSource component named
MySQLSourceName
. Using bindings you can set the DataSource to an expression that can be evaluated as a valid data object e.g. field linking a collection.If you need to change the report's DataSource you will have to reassign it. There are forum threads discussing such dynamic data changes as:
In order to provide you more accurate suggestions, please elaborate on the required dynamic DataSource change - what and how should be changed and how it reflects the report.
Regards,
Stef
Telerik
Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

MySQLSourceName is actually an SqlDataSource component's name in my report. Here's the scenario:
I have two SqlDataSource components in my report. SqlSource1 and SqlSource2. Then I have a report parameter named TheSqlSource. I then bind the report's DataSource property using this expression =Parameters.TheSqlSource.Value.
Then in my C# code I passed the parameter's value:
var theSqlSource = GetDataSourceName();
ReportViewer1.ReportSource.Parameters.Add(
"TheSqlSource"
, theSqlSource);
At first I thought the report is receiving an invalid SqlDataSource name from the parameter, but then i tried removing the parameter and entered the SqlDataSource name directly in the binding expression and it still didn't work.
Changing the report's DataSource using binding to a report parameter providing the name of the data source component will not work, as the expression is evaluated as if you have set myReport.DataSource="string".
You can use custom UI to allow the user to select the data source for the report. Thus you can assign the data prior to displaying it e.g.:
var report = new MyReport();
report.DataSource = GetData(userSelection);
ReportViewer.ReportSource= new InstanceReportSource { ReportDocument = report };
If you prefer to use the report parameters, you can reset the report DataSource which will cause its NeedDataSource event to be fired. Then you can provide the data in the events handler based on the running parameter's value as illustrated in the Using Report Events help article.
i hope this helps you.
Regards,
Stef
Telerik
Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

I need to dynamically provide a ConnectionString to a .trdp at runtime.
I've tried to use a parameter and a binding as stated here: https://docs.telerik.com/reporting/knowledge-base/how-to-pass-connectionstring-to-report-dynamically-through-report-parameter
but I can't get it to work. Without the parameter and binding, the existing dataSource works fine in preview. I'm using Standalone Report Designer 13.2.19.1213. When I add the parameter and binding, and put the connection string value in the parameter input box during preview, I get an error. See the attached picture that shows all settings.
Hi Curt,
From the error message, it seems that the connection string is not correct. There might be a syntax error. Make sure that the connection string that you are passing from the report parameter is the right one. If the issue is not solved, consider sending us the report and database.
Regards,
Neli
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.

After using the equal sign, the report parameter works fine, and I can dynamically switch the connection string.
