簡體   English   中英

Concat將詳細數據分組到Reporting Services中的一行中

[英]Concat grouped detail data into one row within Reporting Services

我在ssrs報告中有兩列 n行 ,顯示詳細數據。 我想這個表的數據Concat的 成一排

我不知道最好的方法是什么。 使用報告服務報告元素fe。 交叉表或更改我的SQL查詢或在報表服務中創建自定義函數? 我想我可以某種方式使其與sql 數據透視表一起使用 ,但是我認為那不是一種優雅的方式,對於大數據來說可能會很慢。 如果有可能在報告服務中做到這一點,請告訴我如何:)

詳細說明:

原始數據顯示了我進行切割優化后的切割計划,每個輪廓的長度為6m。 數據顯示應如何切割3個輪廓。

AtikelNo,Artikelname,ProfilNo,Length in mm

130010002   Alu Profile 1   835.00
130010002   Alu Profile 1   835.00
130010002   Alu Profile 1   835.00
130010002   Alu Profile 1   835.00
130010002   Alu Profile 1   835.00
130010002   Alu Profile 1   835.00
130010002   Alu Profile 1   833.20
130010002   Alu Profile 2   835.00
130010002   Alu Profile 2   835.00
130010002   Alu Profile 2   835.00
130010002   Alu Profile 2   833.20
130010002   Alu Profile 2   833.20
130010002   Alu Profile 2   833.20
130010002   Alu Profile 2   833.20
130010002   Alu Profile 3   833.20
130010002   Alu Profile 3   833.20
130010002   Alu Profile 3   833.20
130010002   Alu Profile 3   833.20
130010002   Alu Profile 3   833.20
130010002   Alu Profile 3   833.20
130010002   Alu Profile 3   833.20

為了提高可讀性,我在我的sql查詢中將相同的長度分組

AtikelNo,Artikelname,ProfilNo,Length,Count
130010002   Alu Profile 1   833.20  1
130010002   Alu Profile 1   835.00  6
130010002   Alu Profile 2   833.20  4
130010002   Alu Profile 2   835.00  3
130010002   Alu Profile 3   833.20  7

因此,我的個人資料1應該分為1 * 833.20和6 * 835.00

我的報告顯示了該表(最多可以包含n個明細行,但通常不超過10個)

130010002   Alu Profile 
1:
   1 x 833.20 
   6 x 835.00  
2:
   4 x 833.20 
   3 x 835.00 

而不是我想以此方式報告

130010002   Alu Profile 
1:
   1 x 833.20 | 6 x 835.00  
2:
   4 x 833.20 | 3 x 835.00 

/編輯

那就是我使用矩陣組件時得到的。 (StabNr是ProfileNo,Laenge是Length,詳細信息顯示了Count和Length。這幾乎是我想要的。問題是如何隱藏空單元格,以便僅在ProfileNo旁邊顯示數據?

矩陣報告

Matrix添加到您的RDL。

Group By ProfilNo 在行

Group By 長度Group By

可以用表格內的 矩陣元素求解。

每個表格行將profileno分組,在另一列中添加矩陣元素。 就像每一行都有自己的矩陣。 這樣就沒有空單元格了。

在矩陣元素中,列按長度分組,行不分組,詳細信息顯示計數和長度。 列和行標題被刪除。

表中的矩陣

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM