• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Fitting JSP page to print margins

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I have a problem with my jsp page when it is printed. The right is often cut off sometimes by quite a bit.

The page in question is a warehouse page, I have a collection of items(dynamically read in from run time and a list of warehouses.

So it will apppear like this

WareHouse|item 1|item2|item3.......
WH1______|100000|21214|45353|.....
WH2______|344343|43242|23422|.....
.
.
.
.

As the items list sometimes grow very long,when I print I only get a partial view of the table on the page.

Would like to ask if there is anyway to make the JSP resize to fix into 1 page width in a landscape mode(on the width part).
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, but the answer has nothing to do with JSP.

It's possible to have separate CSS classes for your screen and printer.
Look up the "media" attribute of the link and style tags.

I'm going to move this to our HTML/JavaScript forum where the CSS gurus hang out.
 
Qingxiong Tang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The main problem lies in I have no idea how long the columms will get until runtime and depending on days. So I am not sure if a seperate css will help as the set font may be too small/large depending on numbers of items.
[ February 20, 2008: Message edited by: Qingxiong Tang ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about multiple tables with an upper limit on the number of rows in each.
One table per page.
 
Sheriff
Posts: 28394
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't you have the same problem with the screen display, i.e. the user has to scroll right to see the whole thing? If so, maybe that's a suggestion that you need to display this table differently. Taking it to the extreme, if you have 100 columns in your table you can't reasonably expect anything to compress that into 8 inches of paper.
 
Qingxiong Tang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup, the user have to scroll right on the screen to see the entire table. The columms isnt too many till 100, which means that most likely it will be visible when printed in landscape.

Rows isnt a problem as it can span many pages. But i cant span both rows and columms

What I need help with is a function much like when printing in Word, you can have a fit to page option such that the width fits into the page margin which resize the document so that it fits into the paper size.


I could set a small font in the CSS but this will mean that the report will not come out nicely when there is much less items, as the words will be small. and will have lots of empty space on the paper. Using I.E 6

Thanks for your help!
[ February 22, 2008: Message edited by: Qingxiong Tang ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic