I have made a program in Java which is used to collect medical data (personal, diagnosis,treatments) from people with cancer. In this program you fill the forms and all these data are then stored to a database.
Now, what I want to make: if the user selects to see a patient's data, I want to give him the possibility to print the patient's record. I know how to print a file using java. But I don't know how to make such a file, how to form it. I mean it's not just printing "Hello world". It may need tables, colors, etc. How should I do this? Is there a way to make a prototype (ex. doc) file and then through the program fill just the data, or I have to fully form this file through my program?
Hope I was clearly understood!
Use a reporting engine like JasperReports or Birt.
These are pretty straightforward to integrate and allow fast and easy creation of printer ready documents and typically also other formats (like excel).
Have a look at JasperReports, which provides the necessary features to generate dynamic reports, including data retrieval using JDBC (Java Database Connectivity). You will need some time to learn it 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