URGENT: Internet Explorer Control: Print not working

S

Shardool Karnik

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.
 
G

Günter Prossliner

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).

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!!!
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top