maddirala Posted February 4, 2004 Posted February 4, 2004 Hi i am doing .net application and when user clicks on button print it has to print landscape automatically without changing their print setups.i would appreciate for any help thanks Quote
kahlua001 Posted February 4, 2004 Posted February 4, 2004 i'm assuming this is in asp.net since its in this forum, then you are trying to have the browser print landscape. there is a attribute in the style sheet of the print media type, but from my experience, most browsers dont support it yet. Quote
maddirala Posted February 5, 2004 Author Posted February 5, 2004 Hi i am not looking for browser print.i have to keep print button on page when user clicks it it has to print landscape. Quote
Cassio Posted February 5, 2004 Posted February 5, 2004 This component can do it and its free. http://www.meadroid.com/scriptx/index.asp But its IE only. Quote Stream of Consciousness (My blog)
*Gurus* Derek Stone Posted February 5, 2004 *Gurus* Posted February 5, 2004 <style type="text/css"> @media print { screen: landscape; } </style> Quote Posting Guidelines
kahlua001 Posted February 5, 2004 Posted February 5, 2004 Derek, that is what i suggested, but I have found that most browsers including the latest IE does not support that. I know other ppl have had the same experience, wondering what are everybody else's results with that? Quote
*Gurus* Derek Stone Posted February 5, 2004 *Gurus* Posted February 5, 2004 Nothing works correctly in Internet Explorer... what's your point? ;) I simply noted that style for reference, since you mentioned it above. Quote Posting Guidelines
chand Posted February 10, 2004 Posted February 10, 2004 (edited) problem in printing landscape Hi I downloaded from meadco scriptx control and installed.i put print button on my .net page and calling java script function.i am getting error like object expected.i couldn't figure why.if anyhelp i would appreciate. I just need to print screen vatever user able to see in IE window here is my code <SCRIPT language=javascript> Function printpr(printWhat){ document.all.btnPrint.style.visibility="hidden" document.all.btnPreview.style.visibility="hidden" // Set required Output values factory.printing.portrait = false; factory.printing.leftMargin = 10.5; factory.printing.rightMargin = 5.5; factory.printing.topMargin = 1.5; factory.printing.bottomMargin = 1.5; factory.printing.header = ""; factory.printing.footer = "Printed: &d&b&bPage &p/&P"; var OLECMDID = printWhat; /* OLECMDID values: * 6 - Print * 7 - Print preview * 1 - Open window * 4 - Save As */ var PROMPT = 1; // 2 DONTPROMPTUSER var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; document.body.insertAdjacentHTML('beforeEnd', WebBrowser); WebBrowser1.ExecWB(OLECMDID, PROMPT); WebBrowser1.outerHTML = ""; document.all.btnPrint.style.visibility="visible" document.all.btnPreview.style.visibility="visible" } </SCRIPT> <INPUT class="label1" id="Button1" style="Z-INDEX: 137; LEFT: 152px; WIDTH: 80px; POSITION: absolute; TOP: 514px; HEIGHT: 29px" type="submit" value="Print" name="Button1" onclick="return printpr(7);"> Edited February 10, 2004 by chand Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.