URGENT: Internet Explorer Control: Print not working

Discussion in 'ASP .Net' started by Shardool Karnik, Aug 12, 2003.

  1. Hi,

    I have an ASP.NET page that sends a request to the server to generate some
    html on the fly and print it through the server.

    Once the request comes in, the page is generated.
    I have a Internet Explorer Control that loads this page on the server side.
    Then I am calling the print function to print that page.

    The code compiles and runs, but this page is not printed after the printing
    request has been executed.
    There is nothing in the print spooler.

    Here is the code
    =======================================================

    Private WithEvents browser As SHDocVw.InternetExplorer
    browser = New SHDocVw.InternetExplorer()

    browser.Navigate(url)

    While (browser.QueryStatusWB(SHDocVw.OLECMDID.OLECMDID_PRINT) <>
    (SHDocVw.OLECMDF.OLECMDF_SUPPORTED + SHDocVw.OLECMDF.OLECMDF_ENABLED))
    End While

    browser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
    SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER)

    =======================================================

    everything executes fine, but there is nothing printed.
    The control navigates to the correct page.

    Does anyone know why it doesn't print ?

    Only reason I can think of is the control is designed for WinForms and not
    for Server Side Classes (not web forms, just a class on the server side).

    Please help!!!

    Regards,
    Shardool Karnik.
     
    Shardool Karnik, Aug 12, 2003
    #1
    1. Advertisements

  2. Only reason I can think of is the control is designed for WinForms and not
    I think that that's the point: Asp.Net normaly running under the
    User-Account ASPNET, witch will have no printers installed. You can try to
    connect to the printer before printing using a .vbs and starting in via
    Process.Start from Application_Start

    GP

    P.S.: Please stop crossposting!!!
     
    Günter Prossliner, Aug 13, 2003
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.