How to create Dynamic Table in Jasper - iReprot (XML as a da

Hi,

I have requirement is to create the dynamic table by reading the XML tag values in runtime. XML file has the tags which will tell us about the number of rows and columns. Also, there are two tags which will tell us about the specific cell to be highlighted. E.g.;

3
3
2
1

3 by 3 table should get displayed in the output with 2nd row 1st column highlighted.
Please does someone worked on this before. Please let me know any hint or pointers.

Hint: can we use a image which will look like 1 by 1 table and repeat it 3 times???

Regards,
Amit

I have made a “temptable” in the database dedicated for this purpose, 10 varchar’s, 10 timestamps, 10 int’s, 10 floats, 1 id, 1 “session_id”
Then enter records into that, with a new “session_id” from within servoy, then query it / join on it from within a query in Jasper.
Little bit of work, but works like a charm.

Sorry, I did not get you.
Please, will you elaborate?

Regards,
Amit Deshpande

Hi,
We do all printing / reporting using Jasper, works absolutely fine.
However sometimes stuff needs to be printed / reported that is not in the database, but generated from within Servoy, such as unstored calculation columns or stuff hat is dynamically calculated from within methods.
You could replicate all that logic within the query in the Jasper-report, however that would be cumbersome and hard to maintain.
For that purpose we have a table in the database dedicated for this purpose (temptable).
It has a pk, and a “session_id”, and 10 columns of each type (int, float, timestamp, blob, varchar)
When it needs to be used, first off we check the max(session_id), create new record with session_id = max(session_id) + 1
then fill the thing with rawSQL plugin from within Servoy, with all relevant values (and each row the determined session_id).
Pass the session_id to the Jasper report as a parameter with your other parameters, and now all in this “temp-table” can be queried, joined on, etc. from within the Jasper report.
Hope it’s of some use to you,
Regards, Hans Nieuwenhuijs