SSRS. Group 2 different parts of a row in the report
I use SQL 2008 I have report with few groups on the left, then some numbers and another numbers (further on the right) which has to be groupped as well.
Field1 Filed2 Filed3 Num1 Num2 Num3 Num4
fff sss aaa 1000 2000 3000 4000
bbb 2000 3000
ccc 4000 5000
i.e. Num3 and Num4 are th开发者_开发问答e same for each combination of Filed1 + Field2
Can I achieve this using BIDS report designer?
Yes - assuming you have already inserted an ungrouped table based on your dataset into your report, and want to group by Field1 and Filed2 alone:
- Insert a group into the table (by selecting one of the rows, and selecting Insert Group from the right-click menu. Specify Field1 and Filed2 as two separate items on both the General and Sorting tabs of the Insert Group dialog, and uncheck the Include Group Header and Include Group Footer options on the General tab.
For each of the Field1, Filed2, Num3 and Num4 cells in the detail row, set the Visibility>Hidden expression (in the Properties window) to be like the following:
=Iif(Fields!FIELD1.Value = Previous(Fields!FIELD1.Value) and
Fields!FILED2.Value = Previous(Fields!FILED2.Value), True, False)
Just add each one you want as a (parent group) with no header or footer, in the order you want them displayed. Then add the rest of the columns you want to always be displayed. The results should look like this.
ParentGrp1 ParentGrp2 Col1 Col2 Col3
Valdez Spill abc xyz 123
bca kfj 222
emf lrl 333
Spill2 abd omc 412
oke ttl 555
If this is what your going for. Otherwise you can always just use Marks technique to make any field in order not display multiple in a row.
精彩评论