This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable.print() does not work

 
Javed Mohammed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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,

Javed Mohammed.
 
Frank Wynants
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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 JTable Excel 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).

If interested I can send this to you.

greetings
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic