Create a Vertical-orientation Report from a One-field Table
【Question】
I’m trying to display BIRT report data (only one field) first vertically till the page ends and then it should continue in the next column of the same page. For example:
A E I
B F J
C G
D H
By using list element I’m able to get the data in horizontal first and then vertically like…
A B C D
E F G H
I J
But I need the data to be displayed in the report as first example. Can this be done using List element? Please let me know how to do this. Appreciate your help.
【Answer】
It’s simple to prepare the one-field data source according to the specified format with esProc:
A |
|
1 |
=myDB1.query("select orderID from sorder").(orderID) |
2 |
=A1.(~.string().split()) |
3 |
=to(A2.max(~.len())) |
4 |
=create(${A1.len().((t=~,A1.fname().(~+string(t)))).conj().concat@c()}) |
5 |
=A4.record(A3.conj(A2.(~.m(A3.~)))) |
6 |
return A5 |
A1: Retrieve the source data.
A2: Split each field value into a string with the comma.
A4: Create a table of the specified format.
A5: Populate A2’s record vertically into A2’s table.
A reporting tool can access an esProc script through JDBC and calls the script as it calls a database result set. Details are explained in How to Call an SPL Script in Java
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProcSPL
SPL Learning Material 👉 https://c.scudata.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProc_SPL