• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to add header and footer to dynamically generated page for print

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

I am trying to create an application print page. The content of the application is dynamic, for example you can add multiple addresses or personal details. So the page lengths are not static. I need to place a header with application number and footer with page number in page x of y format. How can I place the header and footer dynamically?

Any help will be appreciated.

Regards,
Amit
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this for a web app or a desktop app?
 
amitava guha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is for a web application. I am using JSP pages with Struts framework in J2EE.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the printer already puts page X of Y on the page. Not sure why you need to repeat that.

To do it with html/css, it will only really work with browsers that support CSS3 which is not that many.

It normally is better to create a pdf file on the server and make it look pretty that way.

Eric
 
amitava guha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thanks for reply,
Well a PDF file would have been a better choice, but we started with assumption of giving a simple html print only.
The page X Of Y can be resolved by setting [&p Of &P] in the print setup. But still we need to give a header which is a number generated in the code.

Any solution?
 
amitava guha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No solution?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic