July 5, 2006 at 7:51 am
I'm using RS 2005. I want to set up a report that uses a parameter to disable/enable other parameters. I haven't been able to do this so I've gone with a 3 parameter solution, the 1st parameter determines which parameter (#2 or #3) the report uses and repopulates the drop downs for #2 and #3 and uses "--Not Used--" for the display and "-1" for the value. Parameters #2 and #3 have a default value of -1, to fill in the "--Not Used--" (and only) choice for the user. The problem is, the default value is no longer selected on subsequent report runs or if I toggle param #1 multiple times. Any help would be appreciated.
July 6, 2006 at 10:06 am
Did you trying doing a union with another select statement?
Your first statement has the parameters.
Your second statement would be:
select 'default',value
This worked for me with RS2000, but I have not tried it with 2005.
July 7, 2006 at 5:59 am
Thanks, the drop down is populating correctly, here's roughly what I'm using to populate with:
create procedure rpt_procname
@filter int
as
if @filter = 1
select
column1 as valuecolumn
, column2 as displaycolumn
from
table1
else
select
-1 as valuecolumn
, '--Not Used--' as displaycolumn
I set the default value of the filter param to -1, so nothing should be selected if the filter is applied since my table doesn't have negative values in column1. So if the filter is not applied, the drop down should default to "--Not Used--", which it does the first time the report is run. However, running the report subsequent times and/or toggling the filter on and off and on again will result in the drop down not having any value selected, even though the drop down is populated with the correct data.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply