Sql – How to use multiple conditions (With AND) in IIF expressions in ssrs

iifreporting-servicessqlsql server

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.

enter image description here

How can i fix this problem or which expression must i use to get required results?

Thanks in Advance for help.

Best Answer

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

Related Topic