Sunday, November 4, 2012

SSRS grouping dynamically

Initial steps: http://www.ienablemuch.com/2012/11/ssrs-nested-grouping.html

This how-to guide shows how to group by column(user-selected) dynamically. 50 steps

If you want to group on a column that is in a group section, meaning you need to hide that selected column(the option Column Visibility when on group section, is not available even in SSRS 2012) by the user, follow this guide: http://www.ienablemuch.com/2012/11/ssrs-hiding-a-column-from-group.html

1

2

3

4

5
6

7

8

9

10
11

12

13

14

15

16


17

18

19

20

21

22

23

24. We got to format the grouped column if it is a date

25. To do that, we set its Text Box Properties

26. Go to Number tab, then choose Custom

27. Then put the above expression

28. Then conditionally hide the column if the grouping is on that column

29

30

31

32

33

34. Hide the Order Date conditionally too (if the grouping is on Order Date)


36




37

38. Good

39. Good, the Order Date displays accordingly. But it is not yet quite good. Even we group on Order , the date is  displayed via Customer name's order. The latest Order Date on AdventureWorks database is June 2008

40. We must set the order based on the grouping column

41. The default was CustomerName

42. Click the fx expression button. The above will appear

43. Then change the expression with the above simple expression. As we cannot do conditional order (ascending vs descending), we will just put the descending Order Date on a separate sorting option

44. Your sort by should appear as Expr

45. Then add another column

46. The expression that shall appear on another order expression

47

48

49. Change the Then By's sorting to descending

50. The sorting is correct now


Happy Coding! ツ

No comments:

Post a Comment