繁体   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