Last post Aug 07, 2019 02:23 AM by Wei Zhang
Aug 06, 2019 03:42 PM|ExceedingLife|LINK
I currently have an MVC project that im going to be able to be switching 3 databases depending on the group of people using it. The databases all have the same tables. 1 is for the global engineers, 1 is for local production and 1 is for local testing.
How should I have my rdlc reports so I can switch to a different database easily? I have my project so I just have to change a connectionstring in web.config and then the context in each controller. Then the database is changed. For a Rdlc report it will
be a little harder than that, do I need to add another dataset and just have to change that? On my reports it only allows me to add 1 data source at a time but in the datasets I can have multiple and each 1 can point to its own connectionstring.
Aug 07, 2019 02:23 AM|Wei Zhang|LINK
According to your description, do you have three connection strings for three databases in web.config file?
Since reportviewer control uses rdlc as the datasource ,I think you should create multiply rdlc file as different datasource you want to replace. For example, if you want to replace the datasource of reportviewer ,you could firstly create a new rdlc file
and set dataset on it.Then you could create datasource for report view and replace the original one by writing code in some trigger.