• 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

Print Preview is different from jsp page displayed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
I am developing jsp reports. My problem is that, the displayed jsp on browser is not same as print preview. Its not showing the background color of table, table header and table rows. Its just showing the plane text in print preview mode. What amy be the problem? is thre any solution? like how jsp appears at browser same should be printed. Please any one help me out.
thanks & regards
dkumar_sharma
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This really has nothing to do with whether the HTML page was generated with JSP or whatever, so I'm moving this to the HTML/Javascript forum.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your browser's settings are set to not print those things.
If you look at IE tools-internet options-advanced-->Scroll about halfway where you see printing. There will be a checkbox that says something like print backgrounds and images. Check that and it will print.
And before you can ask, no you can not set this on other people's machines!
Eric
 
Greenhorn
Posts: 2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dharmendra,
Please set these below lines in your jsp(after import)-

response.setContentType("application/ms-excel");
response.setHeader("Cache-Control", "public");
response.setHeader("Pragma", "public");

I think it will generate the report in proper format.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing like pulling up an old post with wrong info. Why would you say an HTML page is an excel worksheet? Yikes.

Eric
 
prateek g gupta
Greenhorn
Posts: 2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eric,

I have faced the same scenario where a report had to be print and the print preview format of the report was .xls.
That's why I thought that Dharmendera is facing the same case.
So I suggested him to set header.
 
Bear Bibeault
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That header has nothing at all to do with the issue. All it does is tell the browser that the response contains an Excel spreadsheet which is not the case here.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic