I just want to hide rows in SSRS report having Zero Quantity.. There are following multiple Quantity Columns like Opening Stock , Gross Dispatched,Transfer Out, Qty Sold, Stock Adjustment and Closing Stock etc.. I am doing this task by using following expression.
=IIF(Fields!OpeningStock.Value=0 AND Fields!GrossDispatched.Value=0 AND
Fields!TransferOutToMW.Value=0 AND Fields!TransferOutToDW.Value=0 AND
Fields!TransferOutToOW.Value=0 AND Fields!NetDispatched.Value=0 AND Fields!QtySold.Value=0
AND Fields!StockAdjustment.Value=0 AND Fields!ClosingStock.Value=0,True,False)
But by using this expression in row visibility, report hides all the rows except Totals Row. Even though report should show rows having Quantities of above mentioned columns. Total values are shown correct.
Note: I set this row visibility expression on Detail Row.
Without using expression result is as following.
For the first 2 rows all the quantities are 0 (ZERO), i want to hide these 2 rows.
How can i fix this problem or which expression must i use to get required results?
Thanks in Advance for help.
It’s a decision function that may be invoked via expressions. The keyword for an If statement in SSRS is IIF. SSRS interprets expressions to set property values and constructs expressions using simple constants, parameters, dataset fields, functions, and operators.
Thanks for any kind of help! In SSRS, to can use Multiple AND or Multiple OR in IIF expression, you just need to enclose each condition with parenthesis () as the following: In your case, the Multiple OR condition in IIF expression should be
However, you can clearly see that the nesting of iif statements, especially if you have a large number of values, could quickly get very complicated and difficult to follow. Most folks who work with T-SQL would say, let us just use a Case statement. While that could be used in the dataset T-SQL query, it is not available in SSRS.
First, the iif function is likely the most common logical function as it is synonymous with similar functions in many programming languages. However, it does not contain an elseif element, and thus nesting is required if multiple branches and outcomes are required. To address the nested iif functions, SSRS also provides a switch function.
Could you try this out?
=IIF((Fields!OpeningStock.Value=0) AND (Fields!GrossDispatched.Value=0) AND
(Fields!TransferOutToMW.Value=0) AND (Fields!TransferOutToDW.Value=0) AND
(Fields!TransferOutToOW.Value=0) AND (Fields!NetDispatched.Value=0) AND (Fields!QtySold.Value=0)
AND (Fields!StockAdjustment.Value=0) AND (Fields!ClosingStock.Value=0),True,False)
Note: Setting Hidden to False will make the row visible
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With