SSRS - How to build a simple multi-column report?

后端 未结 3 888
滥情空心
滥情空心 2020-11-27 22:46

I am using SQL Server 2008 and I want to show 1 single field from a table in multiple columns in the report. Just like if I were to print labels. How can I achieve this?

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 23:13

    For Horizontal layout of labels...

    One choice is to use the columns property on the report or body elements. This doesn't always display correctly On reportviewer. I've noticed that even if it displays correctly on your IDE and when you export to PDF. In the report viewer it will display only one column. Also it snakes the labels top to bottom then left to right.

    One choice is to use a matrix and group on every 3 rows (if you want 3 columns).

    This one is a little complicated.

    My solution of choice is to put 3 vertical lists on the page. put the same label in each list. Return the row number in your dataset. Then just filter each list on modulo 3

    For example

    Result set

    RIndex Fname
    1 abe
    2 burt
    3 fred
    4 george
    

    Filter expressions

    list 1 -> =Fields!RIndex.Value mod 3 = =1
    list 2 -> =Fields!RIndex.Value mod 3 = =2
    list 3 -> =Fields!RIndex.Value mod 3 = =0
    

    Result

    Abe Burt Fred 
    George 
    

提交回复
热议问题