User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,165 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,344 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 2246 | Replies: 6
Reply
Join Date: Nov 2007
Posts: 7
Reputation: vsr is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vsr vsr is offline Offline
Newbie Poster

Help javascript print in landscape

  #1  
Nov 14th, 2007
Hi All,
I have a webpage written in c# asp.net. The page has a datagrid and a print button. The print button has the javascript onclick="javascript:window.print();"

I want to be able to change the print preference to LandScape.
I tried using CSS but because I have a datagrid its not working. CSS works if I don't have the datagrid.
This is kinda urgent.

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: USA
Posts: 2,504
Reputation: Ezzaral is just really nice Ezzaral is just really nice Ezzaral is just really nice Ezzaral is just really nice 
Rep Power: 10
Solved Threads: 252
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Maven

Re: javascript print in landscape

  #2  
Nov 14th, 2007
Try asking over in the javascript forum. This is the Java (programming language) forum.
Reply With Quote  
Join Date: Feb 2006
Posts: 1,356
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 113
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: javascript print in landscape

  #3  
Nov 14th, 2007
Have asked to have the thread moved.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Jan 2007
Posts: 2,433
Reputation: MidiMagic is on a distinguished road 
Rep Power: 6
Solved Threads: 99
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Posting Maven

Re: javascript print in landscape

  #4  
Nov 15th, 2007
That attribute does not belong to the web designer. It belongs to the owner of the computer that is displaying the web page. It's in his printer settings on his hard disk. It is an Internet security violation for a web page to change the internal settings on a user's computer.

Think of the lost business time a user might incur if his printer orientation is suddenly changed without his knowledge. He might print twenty documents, and then walk over to the printer and
find that he has to print all of them again. A certain basketball coach might throw the printer across the room.

IE has a nonstandard way to change the print orientation from a website (and puts it back after the user leaves that site), but it doesn't work on other browsers.

Just ask the user to make the setting change before printing.
Last edited by MidiMagic : Nov 15th, 2007 at 2:07 am.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Nov 2007
Posts: 7
Reputation: vsr is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vsr vsr is offline Offline
Newbie Poster

Help Re: javascript print in landscape

  #5  
Nov 15th, 2007
This is an internal site and the users them selves want it. IE is the only browser they use.
Reply With Quote  
Join Date: Jan 2007
Posts: 2,433
Reputation: MidiMagic is on a distinguished road 
Rep Power: 6
Solved Threads: 99
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Posting Maven

Re: javascript print in landscape

  #6  
Nov 15th, 2007
I don't know the code to do that. Note that it will not work with strict doctypes.

Normally the portrait/landscape setting is stored in a document, or (in the case of a web browser) is set as a default.
Last edited by MidiMagic : Nov 15th, 2007 at 8:20 pm.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,732
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 323
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: javascript print in landscape

  #7  
Nov 16th, 2007
Maybe this would be of some help to you.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:34 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC