Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 parameter enable and disable on basis of value

Author  Topic 

scottichrosaviakosmos
Yak Posting Veteran

66 Posts

Posted - 2011-04-12 : 12:59:36

I have a report and I have to use a stored procedure to display final output.
now i have to use four parameters and the report will be generated on the basis of these parameter values.
Now the problem is that one of the parameter of the four should be displayed as a dropdown on my preview page as i want them use to select only one value.
The values in the dropdown are 1,2,3.
now the challange:-(the other parameters should be textbox and not dropdown where user will fill there value)
1) the textbox should be displayed on basis of dropdown value selected.
2) only one of the parameter textbox should be displayed at a time.
ex:
if(dropdown value=1) then
display parameter1 textbox
if(dropdown value=2) then
display parameter2 textbox
if(dropdown value=3) then
display parameter3 textbox

This means at a time only one textbox will be displayed on paramter one dropdown value selection.

How to get this done.?

scoo

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-04-12 : 13:24:31
Why not just rewrite the stored procedure to accept 2 parameters and then do the appropriate logic:
CREATE PROCEDURE #report @dropdown int, @text varchar(100) AS
IF @dropdown=1
... code goes here
IF @dropdown=2
... code goes here
IF @dropdown=3
... code goes here
If that's not possible, have your report call a wrapper procedure that takes 2 parameters and makes the appropriate call:
CREATE PROCEDURE #wrapper @dropdown int, @text varchar(100) AS
IF @dropdown=1 EXEC myReport @param1=@text
IF @dropdown=2 EXEC myReport @param2=@text
IF @dropdown=3 EXEC myReport @param3=@text
Either approach is going to be a lot easier than getting the UI to show or hide separate controls.
Go to Top of Page

scottichrosaviakosmos
Yak Posting Veteran

66 Posts

Posted - 2011-04-12 : 14:20:05
yup, but i want to first display option to user that to which option he want to search result. eg. : if from dropdown he selects 1 then name textbox should display else empcode textbox and after selection of dd value the respective textbox will be displayed to user and then user will enter value and search.

scoo
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-04-12 : 14:50:56
So you're saying that they can search for up to 3 different criteria, but you only want 1 of them to display at a time?
Go to Top of Page

scottichrosaviakosmos
Yak Posting Veteran

66 Posts

Posted - 2011-04-12 : 15:09:38
yup..exactly right . thats wt i want.

scoo
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-04-12 : 15:37:12
Is there any particular reason you can't have 3 textboxes with Name, EmpCode, and whatever the other parameter is as captions? I haven't done RS UI development, but I know the standard UI can't do this easily, if at all.
Go to Top of Page
   

- Advertisement -