Present Data in Multi-Column Report Layout

l  Problem

This is a problem about report development. With this example, the flexible computation mechanism of esProc can be fully demonstrated. esProc is even capable of handling the reports requiring irregular layouts.

The problem is pretty simple: to change the layout of the following Names table to display data in 3 columns, namely, name1, name2, and name3. It is also expected that the code can also easily enable us to rearrange the table in columns of any number if possible.



l  Tip

General steps: You can use esProc record function to get this done.

1. Use the record function to write the name sequence to a new table.


l  Code






Convert values of name field to a sequence



Create the multi-column target table



Write A1 into A2’s table using record function


With this piece of code, if you want to display data in more columns, you can simply write the desired structure in cell A2and the names will be populated according to the new structure.


l  Result