Reporting services + sort expression

眉间皱痕 提交于 2020-01-05 05:56:10

问题


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.


回答1:


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:

  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.



来源:https://stackoverflow.com/questions/3706732/reporting-services-sort-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!