views:

43

answers:

1

Greetings, In my reporting services I would like to add sorting. Is there any way I can add sorting by two fields inside one column's sort expression? something like:

=Fields!SomeValue1.Value
=Fields!Somevalue2.Value

when I use this sort expression, values are not sorted correctly. Values I would like to sort are something like

SomeValue1    SomeValue2
10            11
9             1
20            21
13            12
13            7
17            6

The case is that SomeValue1 and SomeValue2 comes from another value that as follows:

10-11
9-1
20-21
13-12
13-7
17-6

Any help would be appreciated.

A: 

I can think of three possiblities:

  1. (Simplest) Include an order by SomeValue1, SomeValue2 clause at the end of your SQL query.
  2. Sort by two expressions in Table Properties - ie. in the Sorting tab in the Table Properties dialog, enter =Fields!SomeValue1.Value as the expression on the first line, then click on the line below and enter =Fields!SomeValue2.Value - like so: alt text
  3. (Hardest) Sort on a single expression in Table Properties consisting of SomeValue1 and SomeValue2 converted to 0-padded, fixed length strings, concatenated together - similar to the original value, but formatted consistently, like so: 0000000001-0000000001.

I recommend the first approach.

Mark Bannister
I have resolved it in that way: =Cint(Fields!SomeValue1.Value * 1000 + Fields!SomeValue2.Value)
niao
That will work, too (as long as SomeValue2 doesn't go above 999).
Mark Bannister
yes I know that..
niao