Create a printable form with ireport, prefilled from database?

80 Views Asked by At

I'm trying to create a form with ireport 5.1.2 that will serve as a template that I will integrate in my java application, the form should contain checkboxes, and textfields.

Then from my application, by clicking on a button a PDF will be generated with those checkboxes checked, and those textfields filled from the database.

I just want to know if that's feasible with ireport, or if there is another tool that could do the trick?

1

There are 1 best solutions below

0
On

I found a solution to my problem, probably not the most elegant but still, one that works just fine.
All I had to do is create the form with static text labels, then use the report query to generate needed fields.
As for the checkboxes, since I didn't find a way to create them, I put two images: one of an unchecked checkbox, and one of a checked one, then used the printWhenExpression to render one them on a condition (because if I did forgot to mention it in my question the user do not edit the form manually). This way, if my user enters his informations on a web form, all the data will be saved to the database, then he can finally print the form prefilled with his data.
Do you think there is a better way to achieve that?