Showing results for 
Search instead for 
Did you mean: 

Split up columns dynamically of a cross tab report

Former Member
0 Kudos


I have a report in which i am dynamically generating the pay codes and the respective amounts column-wise. The point is I could not accomodate all the columns in a single page so I want the split up the columns into multiple lines.

For example, I have different employees and I would want to show the pay codes under each employee number with the amount in a cross-tab. If the no. of columns exceeds 10, then I would want to show the remaining columns into the next line and so on.



Employee: 1001

PC1     PC2     PC3     PC4     PC5     PC6     PC7     PC8     PC9     PC10

100     100     100     100          100         100     100     100     100     100

PC11     PC12     P13

100     100          100

Any help is appreciated.

Thanks & Regards,


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Finally, I have found a solution for this. The steps are as follows:

Create a command to dynamically get the no. of records returned by the query

<select count(paycode) RECCOUNT from paycodemstr>

which are then placed in the cross tab columns. For example, if there are 20 pay codes available in the PAYCODE MASTER table, then the query will return 20 which will then be shown in the cross-tab columns with the respective amounts.

Create three formulas

1) EachPayCode:

Global Numbervar Recno;


Recno := Recno + 1

2) GroupPayCode:

EvaluateAfter ({@EachPaySumGrp});

Global Numbervar Recno;

int((Recno -1) / 15);

// Replace 15 with the actual no. of columns required in a line so that the remaining columns will be continued in the next line and so on

3) Reset

Global NumberVar Recno;

if {@EachPayCode} = {PSGCOUNT.RECCOUNT} then

// PSGCOUNT.RECCOUNT is the no. of rows returned by the query used in the command object

Recno := 0



Create a group Employee as the cross tab to display the list of paycodes in a cross tab by employees

Create a group with the formula field GroupPayCode

Create another group under GroupPayCode based on employee again and place the cross tab into this group header

Now, the report displays the paycodes with the amount in columns and automatically wraps after every 15th column in the cross-tab for every employee in the expected order.

Create a cross tab and add the field paycode into the columns.

Place the cross tab into the

Answers (0)