2014-01-07 43 views
5

我是Sql Server Reporting Services的新手。我創建了我的以下報告。 我想要刪除/隱藏品牌清單中不存在的品牌總計行。在下面的圖片中,我想刪除/隱藏「Ethnic Total」,而「Sample Store 1」中不存在「Ethnic」品牌。 相似,我想從第二部分中重新找到/隱藏「Outfitters Total」和「Junior Total」的行,而「Sample Store 2」中不存在「Outfitters」和「Junior」。
My Sample ReportSSRS 2008:如何隱藏基於分類字段的表格行(有條件)

這是我的報告結構。 Report Structure

以下是單品牌淨總量的表達式。

= SUM(IIF(領域!Brand.Value = 「Outfitters的」,田!Quantity.Value,爲Nothing))

我應該怎麼辦? 我應該在行可見性表達式中寫什麼條件?

在此先感謝您的幫助。

回答

4

我希望你正在尋找下面的評論。

步驟1:選擇該特定行(Outfitlers Total,Junior Total,Ethnic Total,Store Total) 單擊一次並右鍵單擊並選擇Row Visibility Option。

步驟2:顯示帶有3個選項

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

選擇選項3,並在表達式對話框複製下面表達式 的對話框。

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

我希望所以這會有所幫助。

+0

非常感謝你這是爲我工作的完美答案.. –

1

隱藏表達式的另一種可能性是使用文本框引用。在下面的表達式中,可以使用文本框的名稱代替「Textbox1」,該文本框位於「淨數量」列和「民族總數」列的交叉點(或您提到的其他總行數)

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

你可以這樣說:

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

替換「YourField」用自己的一個,改變「YourValue」任何你需要的。

NB 「」 或 '' 不視爲NOTHING

詳細的解釋: SSRS – Hide Rows in a Group based on a Value

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

與你正確的字段名稱替換TotalRems