Using parameter to select table
Hi, I'm developing a data dictionary using SSRS 2008 that reports of different tables. The Tables are all in the same database. I already got a report that shows all the table names (approx. 30) in the database. What I would like to do is create a link on this report and then pass the selected table name as a parameter to a new report. This all works fine, however the tricky part is yet to come. It would be great if someone could tell me if and how it's possible to create a query in the new report similar to: Select * from @parameter (where @parameter is the table name selected on the main report) Then the next step would be to show the result in a table. I also can't figure out whether this is possible as most table names are unique, perhaps someone has already achieved the same? Any help would be highly appreciated. Thanks, Hendrik
June 17th, 2011 1:59am

Hi Hendo1000, You Can Achieve this by Following Steps: 1.Create a Action in Your MainReport Table on the Table Cell.--->Jump to Report. 2.Create Your SubReport and Create a Parameter Named TableName. 3.Create a Dataset in your SubReport which Refers to @TableName Which is Passed from MainReport. Hope this is Useful and Solve your Problem.Rakesh M J Dont forget to mark it as Answered if found useful MCTS,MCITP,MCSS http://mycubeandreports.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2011 5:52am

Hi Hendo1000, From your scenario, you would like to pass table name as a parameter to a new report, and then the table will be shown in the new report, in another way, the table content in the new report can be changed based on the parameter, right? Please correct me if my understanding is wrong. I am afraid it is impossible to achieve in reporting services. When we need to show the result in a report, we must define the dataset previously and then drag filed names to the tablix, and the reporting services could process the report and we can see the result. If we declare the table as a variable, we can not define the tablix based on the dataset in the report designer, so that we cannot see the result. I suggest you defining all tablixes based on datasets previously that you need to show in the new report, and then set the Hidden property of tablix visibility properties using the following expression : =Iif(Parameters!tablename.value=table1,false, true), the tablename is the parameter from the main report also. If you have any question, please feel free to ask. Thanks, Eileen
June 22nd, 2011 4:13pm

Hi Rakesh, Thanks for your reply, however it doesn't work. When referring to the parameter in the SQL query I receive an error. Some research learned me that I have to use a stored procedure Hendrik Veenstra
Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2011 1:49am

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

Other recent topics Other recent topics