Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Hide multiple Columns based on Parameter value in SSRS 2004 Expand / Collapse
Author
Message
Posted Saturday, September 01, 2012 12:42 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 24, 2012 10:26 PM
Points: 16, Visits: 77
Can anybody tell me how to hide/show multiple columns based on multivalued parameter.
ex :i have two parameters
1)item
2)option(multivalued - ven,itm,qty) and values are (venr,itm,qty).

i have a dataset contains 3 columns vendor,itm,qty.based on the item i select in the "item" parameter it fetches the respective ven, itm,qty,i want to select which column to be displayed,for this i have created option (multivalued parameter) and used the below mentioned condition in the respective column visibility expression:

=IIf(Parameters!option.Value(0) = "ven",FALSE,TRUE)
=IIf(Parameters!option.Value(0) = "itm",FALSE,TRUE)
=IIf(Parameters!option.Value(0) = "qty",FALSE,TRUE).

its working fine if i select any one option in option parameter.its not working if i select more than option in option parameter.thta why i cant hide/show more than 1 column at a time.


  Post Attachments 
1.JPG (10 views, 110.75 KB)
2.JPG (7 views, 111.38 KB)
3.JPG (6 views, 111.52 KB)
Post #1353124
Posted Friday, September 07, 2012 4:39 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 12:35 PM
Points: 6,650, Visits: 5,666
I believe you have to nest your IIF code to account for all possible permeations of the parameters. It's been a while since I used SSRS, though, so I'm not 100% on that.

Brandie Tarvin, MCITP Database Administrator, MCDBA, MCSA

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1355888
Posted Thursday, September 13, 2012 6:57 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 4:59 AM
Points: 139, Visits: 469
yudy.varma (9/1/2012)
Can anybody tell me how to hide/show multiple columns based on multivalued parameter.
ex :i have two parameters
1)item
2)option(multivalued - ven,itm,qty) and values are (venr,itm,qty).

i have a dataset contains 3 columns vendor,itm,qty.based on the item i select in the "item" parameter it fetches the respective ven, itm,qty,i want to select which column to be displayed,for this i have created option (multivalued parameter) and used the below mentioned condition in the respective column visibility expression:

=IIf(Parameters!option.Value(0) = "ven",FALSE,TRUE)
=IIf(Parameters!option.Value(0) = "itm",FALSE,TRUE)
=IIf(Parameters!option.Value(0) = "qty",FALSE,TRUE).

its working fine if i select any one option in option parameter.its not working if i select more than option in option parameter.thta why i cant hide/show more than 1 column at a time.


I guess you have taken the first value out of the three values in Multiselect parameter.
"=IIf(Parameters!option.Value(0) = "ven",FALSE,TRUE)"

You have to remove that array index values for the expression.
Instead Join them using "=JOIN(Parameters!option.Value,",")" and then use a like filter in the expression.


--Divya
Post #1358525
Posted Thursday, September 13, 2012 6:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 4:59 AM
Points: 139, Visits: 469
Divya Agrawal (9/13/2012)
yudy.varma (9/1/2012)
Can anybody tell me how to hide/show multiple columns based on multivalued parameter.
ex :i have two parameters
1)item
2)option(multivalued - ven,itm,qty) and values are (venr,itm,qty).

i have a dataset contains 3 columns vendor,itm,qty.based on the item i select in the "item" parameter it fetches the respective ven, itm,qty,i want to select which column to be displayed,for this i have created option (multivalued parameter) and used the below mentioned condition in the respective column visibility expression:

=IIf(Parameters!option.Value(0) = "ven",FALSE,TRUE)
=IIf(Parameters!option.Value(0) = "itm",FALSE,TRUE)
=IIf(Parameters!option.Value(0) = "qty",FALSE,TRUE).

its working fine if i select any one option in option parameter.its not working if i select more than option in option parameter.thta why i cant hide/show more than 1 column at a time.


I guess you have taken the first value out of the three values in Multiselect parameter.
"=IIf(Parameters!option.Value(0) = "ven",FALSE,TRUE)"

You have to remove that array index values for the expression.
Instead Join them using "=JOIN(Parameters!option.Value,",")" and then use a like filter in the expression.

You can use = IIF(JOIN(Parameters!option.Value,",")" Like "*ven*",False,True)


--Divya
Post #1358527
Posted Friday, September 14, 2012 12:04 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 24, 2012 10:26 PM
Points: 16, Visits: 77
Thnks divya..its working
Post #1359054
Posted Friday, September 14, 2012 1:10 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 4:59 AM
Points: 139, Visits: 469
yudy.varma (9/14/2012)
Thnks divya..its working


I am glad it helped you :)


--Divya
Post #1359075
Posted Friday, September 14, 2012 9:18 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, May 06, 2013 6:38 AM
Points: 1,762, Visits: 462
I was looking at a similar problem and that is a smart solution Divya - thank you

Tom in Sacramento

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1359405
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse