简体   繁体   中英

Enable/Disable visibility of a column based on another column value in SSRS 2008

I am using SSRS2008 with Microsoft ReportViewer 2010. I have a table in one of my reports like that:

Name <<Expr>> Gender
Jack   20     M

<<Expr>> is defined like: IIF(Parameters!check.Value=1,"Age","Class") . It is working fine!

What I try to do is to arrange the visibility of column Gender based on <>'s value (not the value of @check parameter!). I want user to see age-gender together or only class like:

Name Age Gender
Jack 20  M

or

Name Class
Jack  A

Please note that this report is grouped by Country information and every country is listed in another page like:

---Page1---
Country:France
Name Age Gender
Jack 20  M
Brian 24 M
Ashley 19 F

---Page2---
Country:Germany
Name Class
John  B
Mike  C

This paging also works fine. One problem is that I couldnt manage to enable/disable visibility of Gender based on the second column. When I click <> I did not see an ID or name defined for that structure. In this case, when I right click Gender column and click column visibility, how should complete the f(x) below:

=IIF(<<whatToWrite?>>,false,true)

Any help would be appreciated. Thanks.

If you want to use value of text box in which is used so you can just used text box name in your expression. For example you second column header text box name is "TxtNameorAge" then your visibility expression for Gender column will be:

=IIF(reportitems!TxtNameorAge.value == "Age",false,true)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM