how to write data to a pdf file which is stored on a sql database
Good night,
First time joining a forum.
I have a Group Project for an Object Oriented Programming class,basically we have to create a program that helps student with advisement.
We're using Netbeans and MySQL. The Database has all the courses available and students have to choose which courses they completed and the ones that are still pending. What I want to know is how can I write that information from the database to a pdf file without hard coding it. Is it a query i have to do or queries and where can I get those commands. Sorry for writing so much.
Thanks for your help
Re: how to write data to a pdf file which is stored on a sql database
Are you asking how to dynamically write contents to the PDF file or are you asking how to store a PDF in your database (storing a PDF as a blob in your database is not going to be an issue so I assume it is the former).
Read up on SQL queries if it is the database side of things. You will need to at least get to the stage where you compile a program that connects to the database and SELECT's a record from the database and prints out the fields. The exact statement will depend on the structure of the database and the info you need from it.
Dynamically writing contents to a PDF file is a pain. Especially if it is an existing PDF file you wish to modify. Check out some of the libraries and pick an API which does what you need. I would suggest you experiment creating/writing to a new PDF then develop a template which has all the fields you will require.
As for not needing to hard code anything in a OO programming course... Good luck with that.
Re: how to write data to a pdf file which is stored on a sql database
As for the creating pdf part you might like to take a look at iText
Re: how to write data to a pdf file which is stored on a sql database
Quote:
As for not needing to hard code anything in a OO programming course... Good luck with that.
- indeed
oh hmmm, how about ireports, jasperreports? it is capable of generating reports, RTF formats such as PDF's (correct me if im wrong), i only use these in Report viewing on my last project. Im not that sure about it on generating PDF files