Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing in java - Create a table to print

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

722 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