Solved

Printing in java - Create a table to print

Posted on 2007-11-21
6
1,840 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
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 …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

628 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