SSRS 2008:How to hide a table row (Conditionally) based on category field

我与影子孤独终老i 提交于 2019-12-05 23:13:40

问题


I am new to Sql Server Reporting Services. I have created my following report. I want to remove/hide rows of Brand Total whenever it does not exist in Brand list. Like in following picture i want to remove/hide "Ethnic Total" whereas "Ethnic" Brand does not exist in "Sample Store 1". Similary i want to reomve/hide rows of "Outfitters Total" and "Junior Total" from Section Two whereas "Outfitters" and "Junior" don't exist in "Sample Store 2".

This is the structure of my report.

And following is the expression for Net Qty of a Single Brand total.

=Sum(IIf(Fields!Brand.Value = "Outfitters", Fields!Quantity.Value, Nothing))

What should i do? What condition should i write in expression for Row Visibility?

Thanks in Advance for help.


回答1:


i hope the below comments you are looking for.

Step 1: select that particular row (Outfitlers Total, Junior Total,Ethnic Total,Store Total) One at a time and right click and select Row Visibility Option.

Step 2 : A Dialog box appears with 3 options

1.Show
2.Hide
3. Show or hide based on expression

Select option 3 and copy the below expression in the Expression dialog box.

=iif((Sum(IIf(Fields!Brand.Value = "Outfitters", Fields!Quantity.Value, Nothing))) is nothing ,True,False)

i hope So this will be helpful.




回答2:


=IIF(Fields!TotalRems.Value=0, True, False)

Replace TotalRems with your correct field name




回答3:


You can do this way:

=IIF(Fields!YourField.Value like "YourValue",false,true)

Replace "YourField" with your own one and also change "YourValue" to whatever you need.

NB, " " or '' not treated as NOTHING,

For more explanation: SSRS – Hide Rows in a Group based on a Value




回答4:


another possibility for the hiding expression is, to use a text box reference. In place of "Textbox1" in the expression below, you can use the name of the text box, which is in the crossing of column "Net Qty" and row "Ethnic Total" (or one of the other total rows you mentioned)

=Iif(IsNothing(ReportItems!Textbox1.Value),True,False)


来源:https://stackoverflow.com/questions/20965590/ssrs-2008how-to-hide-a-table-row-conditionally-based-on-category-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!