Set parameter for database name
Hi All How to set parameter for Database name in SSRS report? When report run, It should ask database name. i.e. provide interface to user to enter database name and produce report based on that selected database. Is it possible do this kind of thing in SSRS? If yes please advice me how to do this requirement. Any help appreciate. Thank You
July 17th, 2012 3:19pm

Hi, Yes, this is possible, provided the tables/views/functions referenced in dataset exists in all the databases. Steps to do this.. 1) Create static data source 2) Add a report parameter for database selection from that data source 3) Create another datasource 4) while creation of data source use this expression = "Data Source=.\mssql2008;Initial Catalog=" + Parameters!DatabaseName.Value - Chintak (My Blog)
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2012 3:24pm

Hi Chintak Thank you for your reply. Please explain step 2 ? Thank you
July 18th, 2012 2:50pm

Hey There, Here's a visual explanation of what Chintak has rightly suggested above:  You just need to set the appropriate Database Name to the "DatabaseName" parameter you are creating. HTH. Cheers, IceQBPlease mark correct answers :)
Free Windows Admin Tool Kit Click here and download it now
July 18th, 2012 3:47pm

Hi IceQB Thank you for your reply. Yes it works. Thank you very much for your visual explanation
July 19th, 2012 12:17pm

Hi IceQB Can you tell me how to work send database name as a parmeter when report contains subreport. let's assume report1 consists of subreport which is report2. Then how to set parameter for database name.This thread is old one but now i can not deal with when report consists of subreport. Thanks for help
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2012 12:33pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics