Skip to main content
Microsoft Idea

Power BI

Needs Votes

Allow expressions in connection string for paginated reports to dynamically change the database

Vote (8) Share
Hannes Brits's profile image

Hannes Brits on 09 May 2022 11:45:06

We have a mining ERP system that was developed using .net. We want to use the same workspace and/or Apps for all the clients (i.e. not duplicate everything for each company).


Each client has a different database (i.e. not one cloud database where you just have to select the company). We want to embed Paginated Reports but it does not allow parameters for the Server Name and Database Name like Power BI. We can use URL parameters to set other parameters but it is not available for the Server and Database parameter settings 


We can use the following string to dynamically connect to another database in paginated reports


="Data Source=SAINTTEST;Initial Catalog=" & Parameters!DBName.Value


See article called" Create data conncetion strings - Report Builder & SSRS (dd01/08/2002)

https://docs.microsoft.com/en-us/sql/reporting-services/report-data/data-connections-data-sources-and-connection-strings-report-builder-and-ssrs?view=sql-server-ver15


However, we cannot publish the paginated report to Power Bi Service.. See post below where Microsoft Staff member rpatkar (Power BI Team) replied on ‎09-13-2020 12:54 AM


On Power BI service, we cannot use expressions in connection string for RDL reports. At this time we do not have plans to provide a fix for this issue.


https://community.powerbi.com/t5/Service/Paginated-Report-Expression-In-Connection-String/m-p/939717