• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Page Number on JSP

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,

I am trying to display page number on a jsp for a report task. Can any help?

PS
I know I can let IE do the page number display but is there any other way of doing it?
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The page number in IE, and Mozillla is an artifact of when the browser paginates the screen to fit onto paper when printing it.

If you have a report output and a JSP is rendering it as a long list on one page, you could have the logic that prints out the table in the JSP page to break up the table within the output, so that you can calculate the page number and display it.

for example,
 
Marshal
Posts: 28193
95
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
You have no way, on the server, of knowing how the browser is going to paginate your HTML output when it prints it. The user can direct the browser to change font size, to print in landscape instead of portrait mode, and so on. If you want to control the pagination then HTML is not the right tool. PDF would work better for that.
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are ways of estimating it (MapQuest does a decent job at this) so you might be able to get close for practical purposes, but it'll never be precise. The best way, as previously mentioned, is to use PDF/PS exports.
 
Terence Chan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Travis, Paul, and Scott

First of all, thanks for all of your replies. Moreover, I am very interested in learning more on Travis sugguestion (Since I don't want to rewrite my whole program using pdf)! Appriecate if travis could give me detail (A complete example) on the solution.

Terence
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess using a third-party open source report frameworks is your best bet.
Like JasperReports, or JFreeReports
 
What a show! What atmosphere! What fun! What a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic