Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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.
Posted
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?
Posted (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 by chand

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...