Can I change the datsource report model at runtime

I have some adhoc reports developed in some report models that are published on the report server (we use SSRS 2008). Everything works well. Now in our production environment, we have about forty (40) customers who have their own database (each of them has the same table structures and other database objects). Now the problem is that the client will log into the report server using Windows Authentication and try to view the reports that we need to retrieve SQL data from only the appropriate database. Reports are created using a report model, and each model has a valid data source that is associated with a specific database. We can create forty separate data sources, each of which will be connected to a specific database. My question isIs there any way by which you can change the name of the report model data source dynamically or at run time based on the client name so that at run time the report SSRS retrieves data from the correct database, but not from any other database.

Please help me.

+3
source share
1 answer

I don’t think there is a way to indicate the data source at run time because the data source is part of the report definition (.rdl) and it has some protection around it, preventing a method like find-and-replace. However, there is the functions available in SSRS (an example search for ReportingService2010.cs) for us in .NET applications that allow you to set the data source. I know that I used to be in a project where we deployed using our own created .NET application, which uses these calls to set the data source for publication. This was for SSRS 2005.

, , , BIDS. , , , BIDS ( ). SSRS 2008R2.

+1

Source: https://habr.com/ru/post/1737644/


All Articles