Solved

Printing in java - Create a table to print

Posted on 2007-11-21
6
1,834 Views
Last Modified: 2008-02-01
i wonder if anyone can help.

I currently havea webapp that allows the user to print a table from the screen, and with css hide parts of the page that i do not want to print. But when there is a large number of rows in the table and it goes over 1 page, it looks messy and can cut halfway through a row.

I thought about using PrinterJob, but that creates a Graphice2d object for each page and then send it to the printer (if possible i could loop through the list(and for each page add 20 rows to it) but i have the problem that i do not have a clue how to create the tables using Graphice2d.

Cany anyone help me here, or have any suggestions how i can get this done.

Thanks

Ross
0
Comment
Question by:Rosscowie
6 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 20328161
http://css-discuss.incutio.com/?page=PrintingTables

Has lots of tips...  (like specifying a thead element to appear on every page)

But IE apparently still can break things when it feels like it...
0
 
LVL 4

Expert Comment

by:TheMajestic
ID: 20332560
hi,

For printing in java there is a print framework . u can use it .

The given link will give the details about it
http://www.javaworld.com/javaworld/jw-01-2001/jw-0105-print.html
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JTable.html#print()

i hope it will help u a lot
0
 

Accepted Solution

by:
Rosscowie earned 0 total points
ID: 20653841
Have managed to use iText to create a PDF in browser that the user can print, this givest them more ability to change setting.
0
 
LVL 2

Expert Comment

by:Lunchy
ID: 20692282
Closed, 500 points refunded.
Lunchy
Friendly Neighbourhood Community Support Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now