2015-12-12 73 views
0

我有rdlc文件需要只顯示頂部邊框,其中Description='Sub Total。樣本數據如下:RDLC動態顯示頂部邊框

School1 Name Group 
    Student 1 
    Student 2 
    Student 3 
    Sub Total  
School2 Name Group 
    Student 1 
    Student 2 
    Student 3 
Sub Total 

所以我想線/頂部邊界上小計。 我嘗試了下面的代碼,但是在那之後,在子總數和所有其他記錄上放置了頂部邊框。

=Iif(Fields!Description.Value="Sub Total", "Solid","None") 

預先感謝您!

回答

1

從您的問題中不清楚您使用的是什麼數據結構。

我想在這裏你正在使用的數據集,看起來低於

NameGroup Student Val 
School1 Student1 1 
School1 Student2 2 
School1 Student3 3 
School2 Student1 4 
School2 Student2 5 
School2 Student3 6 

類似於創建的Tablix,將第一列是學生,第二個是瓦爾列。右鍵單擊行標題並添加一個新的行組 - >父組。在NameGroup上對此進行分組。

右鍵單擊學生單元並選擇插入行 - >外部組 - 下面。這個值設置爲小計,和Val下設置新的細胞是

=Sum(Fields!Val.Value) 

選擇Tablix中的所有單元格,並設置邊框爲無。然後選擇您的兩個SubTotal單元格並展開BorderColor以查看所有類別。將頂部設置爲黑色。同樣與邊框機頂盒到固體,如下圖所示

enter image description here

所有這一切都將導致織機這樣

enter image description here

然後,當這個運行時,報告將設計如下所示

enter image description here

它很難與目前位於該問題的詳細程度給予更多的建議,但希望這將能夠引導你到一個合適的解決方案。

更新

非常類似於上面的,如果你正在返回的小計作爲數據集的一部分,則可以使用屬性爲以類似的方式

隨着數據集

之前描述
NameGroup Student Val 
School1 Student1 1 
School1 Student2 2 
School1 Student3 3 
School1 Subtotal 6 
School2 Student1 4 
School2 Student2 5 
School2 Student3 6 
School2 Subtotal 15 

您可以創建一個矩陣如下所示

enter image description here

並設置TopBorderColou r處的顯現細胞的是

=iif(Fields!Student.Value = "SubTotal", "Black", "White") 

TopBorder Style

=iif(Fields!Student.Value = "SubTotal", "Solid", "None") 

如這裏所示

enter image description here

哪位能給的

enter image description here

因此希望這是你所需要的。如果您還有其他問題,請詢問。

+0

謝謝Jonnus。但是我的「小計」被作爲數據集的一部分。它是 '學生姓名' 列NameGroup學生的Val的一部分 School1 Student1 1 School1 STUDENT2 2 School1學生三3 School2 Student1 4 School2 STUDENT2 5 School2學生三6 小計21,用於更新 – hets

+0

見更新上述 – Jonnus

+0

由於答案回答。我在我的代碼中使用了相同的代碼,但它不會將下邊的組數據重置爲「上邊框」。例如第一組記錄「School1」我有'小計'的頂部邊框,它適用於'school2' - >'student1','student2'等,但由於某些原因它不會重設爲「無」。我已經確定默認設置爲上面答案中設置的「淺灰色」 – hets