M
mygroup
Hello Folks,
I have an asp.net application which requires to fill a form. Once the
form is completed, it should print the final page on server side (not
the client side). I tried to use SHDocVw.InternetExplorer object. It
opens up the window but it is hidden(even if it I make visible
property to True). If I given print command, it does nothing. Here is
my code.
I have added reference of Interop.SHDocVw.dll
Imports System.Threading
Try
Dim o As Object
Dim result As Object
ie.Navigate("http://localhost/Default.aspx", o, o, o, o)
ie.Visible = True
While ie.Busy
Thread.Sleep(300)
End While
ie.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, o, o)
Catch ex As Exception
Response.Write("<br>Error occurred<br>")
Response.Write(ex.Message)
'Response.Write("<br>" & ex.InnerException.ToString)
End Try
When I run this code, no error occurs but IE window is hidden. (In
process list it shows IE) For printing, it does not do anything.
Is there anyway I can get server side printing in asp .net?
Thanks
I have an asp.net application which requires to fill a form. Once the
form is completed, it should print the final page on server side (not
the client side). I tried to use SHDocVw.InternetExplorer object. It
opens up the window but it is hidden(even if it I make visible
property to True). If I given print command, it does nothing. Here is
my code.
I have added reference of Interop.SHDocVw.dll
Imports System.Threading
Try
Dim o As Object
Dim result As Object
ie.Navigate("http://localhost/Default.aspx", o, o, o, o)
ie.Visible = True
While ie.Busy
Thread.Sleep(300)
End While
ie.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, o, o)
Catch ex As Exception
Response.Write("<br>Error occurred<br>")
Response.Write(ex.Message)
'Response.Write("<br>" & ex.InnerException.ToString)
End Try
When I run this code, no error occurs but IE window is hidden. (In
process list it shows IE) For printing, it does not do anything.
Is there anyway I can get server side printing in asp .net?
Thanks