Skip to content

Commit c066b8c

Browse files
Added photo for Binding (#1560)
* Added photo for Binding * Update how-to-pass-connectionstring-to-report-dynamically-through-report-parameter.md * Add files via upload * Update how-to-pass-connectionstring-to-report-dynamically-through-report-parameter.md --------- Co-authored-by: Dimitar Nikolov <[email protected]>
1 parent f9cee83 commit c066b8c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

knowledge-base/how-to-pass-connectionstring-to-report-dynamically-through-report-parameter.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,24 @@ Sometimes it is necessary to change dynamically the connection string of a repor
2626
The requirement can be achieved without writing additional code, **_directly in the report definition_** using dedicated report parameters. Here are the steps:
2727

2828
1. In the report definition [introduce a new Report Parameter]({%slug telerikreporting/designing-reports/connecting-to-data/report-parameters/how-to-add-report-parameters%}) (for example _ConnectionStringParameter_) - the connection string will be passed to the Report via this parameter.
29-
2. In the Report or other [Data item]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%}) (Table, List, etc.) where the connection string is supposed to be changed dynamically introduce a new [Binding]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/using-expressions/bindings%}) as shown below:
29+
1. In the Report or another [Data Item]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/overview%}) (Table, List, etc.) where the connection string is supposed to be changed dynamically, introduce a new [Binding]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/using-expressions/bindings%}) as shown below:
3030

3131
```XML
3232
Property path                   |   Expression
3333

3434
DataSource.ConnectionString     |   = Parameters.ConnectionStringParameter.Value
3535
```
36+
37+
![Changed dynamically the connection string by using Binding](images/ChangeConnectionStringdynamicallywithBinding.png)
3638

3739
## Notes
38-
The _DataSource.ConnectionString_ property is not listed in the dropdown and must be typed manually.
3940

40-
The proposed approach cannot be used to modify the Connection String of Report Parameter -\> AvailableValues -\> DataSource as report parameters do not expose Bindings.
41+
The `DataSource.ConnectionString` property is not listed in the dropdown and must be typed manually.
4142

42-
The same approach can be used to modify the _SelectCommand_ Property of the SqlDataSource. The _DataSource.SelectCommand_ should be set in the above code snippet in this case.
43+
The proposed approach *cannot* be used to modify the Connection String of Report Parameter -\> AvailableValues -\> DataSource as report parameters do not expose `Bindings`.
44+
45+
The same approach can be used to modify the `SelectCommand` Property of the SqlDataSource. The `DataSource.SelectCommand` should be set in the above code snippet in this case.
4346

4447
## See Also
45-
[Changing the connection string dynamically according to runtime data](https://www.telerik.com/support/kb/reporting/details/changing-the-connection-string-dynamically-according-to-runtime-data)
48+
49+
* [Changing the connection string dynamically according to runtime data](https://www.telerik.com/support/kb/reporting/details/changing-the-connection-string-dynamically-according-to-runtime-data)
Loading

0 commit comments

Comments
 (0)