问题
I have a report that lists some basic data about a company for all (possibly) 52 weeks of the year. The report takes in parameters of year and UptoWeek. So for example i can put in 2013 and 31 and it will spit out all the values for year 2013 up to week 31. Right now it looks like:
Week Dollars PY Dollars Change
1 5 4 1
2 20 25 -5
...
52
I want it to split into two sets of columns at the halfway point, so the left side is 1-25 and the right side is 26-52 like so
Week Dollars PY Dollars Change Week Dollars PY Dollars Change
1 5 4 1 26
2 20 25 -5 27
... ...
25 52
Is this possible in tablix?
The one thing I was thinking was to just copy the tablix next to itself and hide rows higher than 25 on the left, and lower than 26 on the right. I'm just not sure if that's the best way to handle this...
回答1:
You could set up a column group based on an expression like:
=IIf(Fields!Week.Value <= 26, 1, 0)
Note that this is set to 26, as 26 really should be on the left side, I think.
Your row group expression will need to be something like:
=(Fields!Week.Value - 1) Mod 26
So say I have data like this:
(snip)
And a tablix like this, grouped as above:
With the above grouping, this works for me:
(snip)
This will split your data into two groups based and week and as such will meet your requirements. Since you're only interested in two groups and have a ready-made row number in Week
, you can keep the expression simple.
Side-by-side tablixes would most likely be fine, too, but SSRS is notoriously temperamental with adjacent objects. Using grouping as above keeps this as one item at the designer level.
来源:https://stackoverflow.com/questions/19181556/ssrs-tablix-split-report-into-two-sets-of-columns