6

I am working on SSRS reporting services. I have a table on which I applied group. Originally I had this data:

enter image description here

I changed something in my tablix and created a tablix and added a parent group of Age i.e. left column and then in the right column, I applied an expression: =SUM(Fields!AgeTotal.Value, "Group1") which made the result like this: enter image description here

Now I want 3,3,3 and 2,2 not to repeat and make them 1 row of each group. Like this: enter image description here

UPDATE: enter image description here

ekad
  • 14,436
  • 26
  • 44
  • 46
asma
  • 2,795
  • 13
  • 60
  • 87

1 Answers1

10

Right Click on the details cell and select add Total, then right click on the entire details rows and change it's visibility to Hide. This should do the trick!

EDIT

Setp by step tutorial with Image:

First image example: on the left the result you want, on the right the result you get from a simple grouping.
I'm getting the sum(but you could use a count or whatever aggregation you want) of the field lam_larghezza (which, for your information, is a width) group by different lam_spessore values (which, is a thickness)

I'm sorry but mi IDE is in Italian so here a simple translation:

Aggiungi -> Add
Gruppo -> Group
Righe -> Rows
Raggruppa per -> Group By
Totale -> Total
Dividi Celle -> Split Cell
Visibilità Righe -> Row visibility

enter image description here

Let's start!

Create the dataset for the report and clean the report

Add a table to the report

enter image description here

Add the detail field in the data row

enter image description here

Right click on the full row
Add group -> Row group -> father group -> group by grouping field (should be age)

enter image description here

enter image description here

Click on the detail cell (only the cell not the entire row, and remember that the cell had to be highlighted not the text inside the cell, because two different contex menu appear) -> Add Total

enter image description here

You now have 1 grouping cell and two detail cell

split the grouping field cell

enter image description here

set the visibility of the detail row to hidden

enter image description here

And you are done!

enter image description here

il_guru
  • 8,383
  • 2
  • 42
  • 51
  • This could work if Total works for each group individually. Total displays the total at the footer of the table. The answer of total is 5. – asma Jun 07 '11 at 09:54
  • i made a test and total works for groups too... can you show the layout of the report? – il_guru Jun 07 '11 at 10:15
  • 1
    added a step by step solution – il_guru Jun 08 '11 at 08:30
  • em sorry il_guru but some things are really confusing. e.g. `Step 3 Add the detail field in the data row` and some other as well in coming steps. I will be very thankful to you if you add screen shots with these steps. because im not fully getting the steps. Thank you so much for your concern – asma Jun 08 '11 at 09:27
  • Not have time now at work to do screens, i maybe can provide them later or tomorrow. In my simple example i consider you have two field in the query, the one your are grouping on and the value you are counting/summing (eg: Age, Name and you want the count of all the people with that age), so the detail field is Name while the grouping field is Age. Hope this could help for now – il_guru Jun 08 '11 at 11:02
  • In my first picture, I have shown two columns, Age and total. Are you talking about these two fields returned by query? if im not wrong – asma Jun 08 '11 at 11:06
  • please take your time and provide screenshots whenever get free from your work,it would b great if you can provide them today or tomorrow. Thanks a lot anyway. – asma Jun 08 '11 at 11:07
  • i think i cannot do more than this – il_guru Jun 09 '11 at 08:18
  • Thanks il_guru, you helped a lot. One last thing to ask is: in my IDE, I have Add Total option disabled on the cell on which you applied add total. I can only set add total on group field. Hope you are getting. You can see my edited question for that. If you find any reason for this, please let me know, Otherwise you really did the best for me. Thanks a lot :) – asma Jun 09 '11 at 09:28
  • I noticed that if in your cell you put an expression it disable the Add Total option. Is this? – il_guru Jun 09 '11 at 09:33
  • No, it does not allow to add total on any cell either having expression or not except Group cell. e.g. I can add total in only `lam spessore` – asma Jun 09 '11 at 09:37
  • it's okay no problem. You helped a lot. Thank you so much :) – asma Jun 09 '11 at 11:38
  • 1
    I hope this answer can help many other people so I'm marking this as answer . – asma Jun 09 '11 at 11:39