I have a set to data to be shown in a tabular format using jasper report and currently writing the .jrxml file.
In my dataset, i have data which will serve us to know number of columns for the table, hereby making it dynamic columns for table.
So, the issue is Data fetched from database is row specific; so how can i make it work to convert it to no of columns for table?
I have a dB table from where data is pulled up:
TEST_ID LEVEL LOT_NUM MEAN UNITS PERCENT
--------- ------ -------- ------------- ----------- -------------
GLU 1 1212 2.1 10 22
GLU 2 1314 3.2 10 22
GLU 3 1414 3.3 10 22
I have to create the report likewise:
TEST_ID LEVEL:1 LEVEL:2 LEVEL:3 UNITS PERCENT
------- ------- ------- ------- ----- -------
GLU 2.1 3.2 3.3 10 22
-: Number of LEVEL's becomes the number of columns for particular tests.
Your use case looks like your columns can only be identified at run time. For such use cases,you can look at either of two libraries - dynamic jasper and dynamic reports. I have seen more usage of dynamic jasper over dynamic reports though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With