Sending ASP Output to printer. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Sending ASP Output to printer.

I want to send ASP outputs directly to printer, without displaying in browser. How can I do this ?

Comments

  • lillulillu Posts: 308Member
    Printing happens on the CLIENT. Therefore, you can only control anything to do with printing, from the client and not from ASP. Print settings, initiating the printer can only be triggered from the CLIENT side. Use JavaScript, JScript or CSS to control the Print dialog.
    BTW, I heard there's a way of setting the print dialog not to come up though.


    : I want to send ASP outputs directly to printer, without displaying in browser. How can I do this ?
    :
    :

    [hr][grey]To err is human, but to really foul things up requires a computer. (Farmers Almanac)[/grey] :-)

  • ssvasanssvasan Posts: 101Member
    [b][red]This message was edited by ssvasan at 2003-10-16 3:52:32[/red][/b][hr]
    Just as displaying output in the Monitor as a softcopy, I want to print it to get a hard copy. Instead of sending to Monitor I want to send to the printer, Printer also a resource on the network, can we build any URL for a printer on a network. We are engaged doing a courier service project, this printing matter only to our private use and will be applied to our offices in different cities in INDIA only.



    : Printing happens on the CLIENT. Therefore, you can only control anything to do with printing, from the client and not from ASP. Print settings, initiating the printer can only be triggered from the CLIENT side. Use JavaScript, JScript or CSS to control the Print dialog.
    : BTW, I heard there's a way of setting the print dialog not to come up though.
    :
    :
    : : I want to send ASP outputs directly to printer, without displaying in browser. How can I do this ?
    : :
    : :
    :
    : [hr][grey]To err is human, but to really foul things up requires a computer. (Farmers Almanac)[/grey] :-)
    :
    :



  • ManningManning Posts: 1,621Member
    : I want to send ASP outputs directly to printer, without displaying in browser. How can I do this ?


    Unless your printer has the ability to load up a webpage and print what it is sent, you can't. ASP is done through a web server and some sort of client, so the printing has to be handled on the client side (as someone already pointed out).

    You might be able to do what you want by using VBScript and the Windows Scripting Host interpreter (CScript.exe or WScript.exe), but I can't say for sure.
  • ChipHeadChipHead Posts: 1Member
    Using ASP and IE8 Here is what has worked for me. This will print as soon as the page loads. Good luck! Nothing fancy...










    DA = (document.all) ? 1 : 0





    sub print()



    OLECMDID_PRINT = 6

    OLECMDEXECOPT_DONTPROMPTUSER = 2

    OLECMDEXECOPT_PROMPTUSER = 1



    'on error resume next



    'IE4 object has different command structure

    if DA then

    call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)



    else

    call WB.IOleCommandTarget.Exec(OLECMDID_PRINT ,OLECMDEXECOPT_DONTPROMPTUSER,"","")



    end if



    end sub



    'This will be interpreted during loading.

    'It will write out the correct webbrowser object depending

    'on the browser version. To be sure it works, make sure you

    'include this script block in between the body tags.



    if DA then

    'this must be IE4 or greater

    wbvers="8856F961-340A-11D0-A96B-00C04FD705A2"

    else

    'this must be IE3.x

    wbvers="EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B"

    end if



    document.write ""




Sign In or Register to comment.