【发布时间】:2014-07-10 09:26:35
【问题描述】:
我在 ssrs 报告中有 两列,其中有 n 行,显示详细数据。 我想concat这个表的数据成一行。
我想知道最好的方法是什么。 使用报告服务报告元素 fe。交叉表或更改我的 sql 查询或在报告服务中创建自定义函数? 我想我可以让它以某种方式与 sql pivot table 一起工作,但我认为这不是优雅的方式,而且对于大数据可能会很慢。 如果可以在报告服务中做到这一点,请告诉我如何:)
详细说明:
原始数据显示了我切割优化后的切割方案,每个剖面的长度为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旁边只显示数据?
【问题讨论】:
标签: sql sql-server vb.net reporting-services ssrs-2008