The objective is to get data from the DB and print it.
I got connected to the DB, got the required data. Poplated the data in JTable and used the below mentioned method to print.
It goes to the printer and prints the page with header, a blank box and footer. I checked the JTable and data is populated in it.
I am not displaying the JTable data on the screen, could this be a problem?
Thanks in advance,
posted 8 years ago
The print() method of JTable has lots of problems. When you change the font in the table text gets printed upside-down and other stuff.
I have created an JTableExcel printer API. What it does is take all the data of your JTable and push it into an Excel sheet and print the Excel sheet. You can even use templates (so you only print a number of columns, in a different order, with pre-defined colors).