简体   繁体   中英

Concat grouped detail data into one row within Reporting Services

i got two columns with n rows in a ssrs report, showing detail data. i would like to concat the data of this table into one row .

i wonder what the best approach is. use a reporting services report element fe. crosstab or change my sql query or create a custom function within reporting services? 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. 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. the data shows how 3 profiles should be cut.

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

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

my report shows this table (could be up to n detail rows but usually not more than 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?

矩阵报告

Add a Matrix to your RDL.

Group By ProfilNo on Row .

Group By Length on Column .

could solve it with a matrix element inside a table .

each table row groups the profileno, in another column the matrix element is added. 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.

表中的矩阵

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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