简体   繁体   English

Concat将详细数据分组到Reporting Services中的一行中

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

i got two columns with n rows in a ssrs report, showing detail data. 我在ssrs报告中有两列 n行 ,显示详细数据。 i would like to concat the data of this table into one row . 我想这个表的数据Concat的 成一排

i wonder what the best approach is. 我不知道最好的方法是什么。 use a reporting services report element fe. 使用报告服务报告元素fe。 crosstab or change my sql query or create a custom function within reporting services? 交叉表或更改我的SQL查询或在报表服务中创建自定义函数? i guess i could get it work with sql pivot table somehow, but i think thats not the elegant way and it might be slow for large data. 我想我可以某种方式使其与sql 数据透视表一起使用 ,但是我认为那不是一种优雅的方式,对于大数据来说可能会很慢。 if its possible to do it within reporting services, please let me know how :) 如果有可能在报告服务中做到这一点,请告诉我如何:)

Detailed description: 详细说明:

The raw data shows the cutting plan after my cutting optimization, each profile has a length of 6m. 原始数据显示了我进行切割优化后的切割计划,每个轮廓的长度为6m。 the data shows how 3 profiles should be cut. 数据显示应如何切割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

to make it better readable i group up the same length within my sql query 为了提高可读性,我在我的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

so my profile 1 should be cut into 1*833.20 and 6*835.00 因此,我的个人资料1应该分为1 * 833.20和6 * 835.00

my report shows this table (could be up to n detail rows but usually not more than 10) 我的报告显示了该表(最多可以包含n个明细行,但通常不超过10个)

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

instead of i would like to report it in this way 而不是我想以此方式报告

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

/edit /编辑

that's what i got when using the matrix component. 那就是我使用矩阵组件时得到的。 (StabNr is the ProfileNo, Laenge is Length, the detail shows Count and Length. Thats nearly what i wanted. the problem is how to hide the empty cells, so that only the data is shown next to the ProfileNo? (StabNr是ProfileNo,Laenge是Length,详细信息显示了Count和Length。这几乎是我想要的。问题是如何隐藏空单元格,以便仅在ProfileNo旁边显示数据?

矩阵报告

Add a Matrix to your RDL. Matrix添加到您的RDL。

Group By ProfilNo on Row . Group By ProfilNo 在行

Group By Length on Column . Group By 长度Group By

could solve it with a matrix element inside a table . 可以用表格内的 矩阵元素求解。

each table row groups the profileno, in another column the matrix element is added. 每个表格行将profileno分组,在另一列中添加矩阵元素。 it's like each row has its own matrix. 就像每一行都有自己的矩阵。 this way there are no empty cells for length. 这样就没有空单元格了。

within the matrix element the columns are grouped by length, the rows are not grouped, the detail shows count and length. 在矩阵元素中,列按长度分组,行不分组,详细信息显示计数和长度。 column and row headers are removed. 列和行标题被删除。

表中的矩阵

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM