Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Printing in java - Create a table to print

Posted on 2007-11-21
6
Medium Priority
?
1,847 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

971 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