File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Print in LANDSCAPE orientation ???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Print in LANDSCAPE orientation ????" Watch "Print in LANDSCAPE orientation ????" New topic
Author

Print in LANDSCAPE orientation ????

verduka fox
Ranch Hand

Joined: Jan 18, 2001
Posts: 178
Hello --
I have a JSP site that I have just added a reports section to. One of the reports has 14 columns of data. Printing this in portrait orientation truncates some of the columns. Therefore, I need to print this report in landscape orientation instead of portrait. How do I programmatically change the page setup to use landscape orientation and then when it is finished to reset the orientation to portrait? Is this possible? If not, are there any workarounds available? I have some users who are not familiar with using computers at all; to train them to go to File --> Page Setup --> change the orientation to landscape --> Print the document --> File --> Page Setup --> change the orientation back to portrait each time is not an acceptable solution.
Any suggestions or feedback is greatly appreciated!
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

When I googled for the answer, I thought it would be javascript. But it turns out CSS2 has an answer.

Here's what I could find: http://www.course.com/downloads/newperspectives/crweb2/dhtml/T7.html#Printing
http://www.blooberry.com/indexdot/css/properties/print/size.htm

Also when I googled, I found someone else on JavaRanch who had asked the same question, and they had no reply (until today that is).

verduka fox
Ranch Hand

Joined: Jan 18, 2001
Posts: 178
Mike,
Thanks for your reply. I found the first link on google as well. I tried it, but I couldn't get it to work. I also found another link on google with this CSS2 reference but it said that no major browser supports this feature. I only need it to work in IE 4+ (intranet app so we can control the browser). Any other ideas?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

Been there, did that. Printed to a PDF set to Landscape using the retepPDF API (now GnuJPDF). You can find it on SourceForge.
Or, I think there's some commercial packages if you want fancier PDF's.
PDF's are the format of choice for printing where you care about preserving fonts, layouts, and other formatting info. HTML is a guideline subject to the browser, user, and OS hims, where PDF directives are absolute.


Customer surveys are for companies who didn't pay proper attention to begin with.
verduka fox
Ranch Hand

Joined: Jan 18, 2001
Posts: 178
Tim,
Thanks for your response. Is there anyway to accomplish this without using PDF? Using PDF's is not preferred in our environment. I'd like to find an HTML/JSP solution. Can anyone verify what version of browsers support CSS2? I really appreciate your help.
Ryan Putman
Greenhorn

Joined: Oct 24, 2002
Posts: 2
I am currently researching this same issue.
I've found this at MS's site:
MSDN Print Help
It says to use ScriptX which is a ActiveX utility put out by MS.
Hope it helps.
Ryan Putman
Greenhorn

Joined: Oct 24, 2002
Posts: 2
MeadCo's ScriptX
Here's a link to the actual site for the makers of ScriptX.
You can download it here and read any support documents you may need.
Good Luck.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Print in LANDSCAPE orientation ????
 
Similar Threads
Help about PageFormat (Print)
change print settings through javascript
Jasper Reports lanscape printing
landscape orientation in html page
Change the Printer Orientation??