This is a migrated thread and some comments may be shown as answers.

Crosstab for multi-column list sorting problem

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
K
Top achievements
Rank 1
K asked on 25 Jul 2013, 09:16 PM
I have used information from a related question to develop a report that lists serial numbers in a multiple column format, as shown in the attached picture.  (I must use the crosstab instead of a multicolumn report because this will be a subreport.)

In the example in the attached output picture you can see that I want 4 columns of data, but I only have 10 items, so there are two empty slots.  If the 4th and 8th items shifted up a row, the order would be correct.  I have tried adding sorting to the groups, but it doesn't seem to help.

I have attached a picture of my report design, and my datasource is a simple query:
select serial_number, ROW_NUMBER() OVER(ORDER BY serial_number) as RowNum
from myTable
order by RowNum

What am I doing wrong?  How can I control the sorted order of the output?  I prefer to sort by row (e.g. row1: a b c d, row2: e f g h)

I am using Telerik Reporting Q3 2012.

1 Answer, 1 is accepted

Sort by
0
Accepted
Hadib Ahmabi
Top achievements
Rank 1
answered on 30 Jul 2013, 01:23 PM
Try this:
ROW_NUMBER() OVER(ORDER BY serial_number) -1 as RowNum
so the numbering starts from 0.
Otherwise you need to change the grouping to something like: 
=(Fields.RowNum - 1) / 4    and    =(Fields.RowNum - 1) % 4

Tags
General Discussions
Asked by
K
Top achievements
Rank 1
Answers by
Hadib Ahmabi
Top achievements
Rank 1
Share this question
or