Ask a Question related to ASP.NET General, Design and Development.
-
Robin Dindayal #1
Print rendered .aspx page to server's printer
Does anyone know how I can print a fully rendered .aspx to the
server's printer? I know that, if I wanted to print to the client's
printer it would be easy (ie. use javascript's window.print()).
However, I need to print to the server's printer. I need to print the
fully rendered .aspx page from the codebehind .aspx.cs page to the
server's printer.
I've tried using SHDocVw.InternetExplorer and SHDocVw.WebBrowser but I
just can't seem to get it to work. Any help with this would be
greatly, greatly appreciated!
Thank you!
Regards,
Robin Dindayal, BMath
Systems Developer
Intellitech Innovations Inc.
Robin Dindayal Guest
-
page numbers rendered differently in 2000 and XP
I have a datagrid set up working correctly with custom paging of numeri values. I tested it in WIndows XP and the page numbers are rendere nicely... -
Accessing a aspx page using HttpWebRequest from another aspx page on the same webapp
Did you have any luck on this as I have the same problem. Maybe you can help me out of you solved your problem. -
Loading a rendered PHP page into flash?
Please don't crosspost - pick the best forum for the question and stick with it, otherwise you get people wasting time answering questions that have... -
Alter Rendered HTML for page
I'm trying to implement XHTML standards in my ASP.NET web pages but whenever I use web controls I get problems because of the very strict nature of... -
how to interact client script within aspx page to other page functions, etc.? PLEASE!!!
Hi, I've spent all day trying to find some info on this...please help! I have an aspx page with an xmlDocument (not dataset/relational db) with... -
Robin Dindayal #2
Re: Print rendered .aspx page to server's printer -> ExecWB gives error message, "The object invoked has disconnected from its clients."
This is my latest attempt at getting this to work....
------------------------------------------------------------------------
// Get the WITH type from the to moniker
Type IETipo = Type.GetTypeFromProgID("InternetExplorer.Applicati on");
// Create the NET proxy class
Object IEX = Activator.CreateInstance(IETipo);
// Set visible true
IETipo.InvokeMember("Visible",
System.Reflection.BindingFlags.SetProperty, null, IEX, new object [] {
false });
// Call method
IETipo.InvokeMember("Navigate",
System.Reflection.BindingFlags.InvokeMethod, null, IEX, new object []
{ "http://www.google.ca" });
// Print it
Object o = null;
object [] args = {OLECMDID.OLECMDID_PRINT,
OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, o, o};
ParameterModifier[] ParamMods = new ParameterModifier [1];
ParamMods[0] = new ParameterModifier (4); // inititialize with
number of method parameters
ParamMods[0][2] = true; // set the 3rd param to be an out
param
ParamMods[0][3] = true; // set the 4th param to be an out
param
IETipo.InvokeMember("ExecWB",
System.Reflection.BindingFlags.InvokeMethod, null, IEX, args,
ParamMods, null, null);
------------------------------------------------------------------------
And here is the error message that I get...
"...
The object invoked has disconnected from its clients.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The
object invoked has disconnected from its clients.
Source Error:
Line 832: ParamMods[0][2] = true; // set the 3rd param to
be an out param
Line 833: ParamMods[0][3] = true; // set the 4th param to
be an out param
Line 834: IETipo.InvokeMember("ExecWB",
System.Reflection.BindingFlags.InvokeMethod, null, IEX, args,
ParamMods, null, null);
Line 835:
Line 836:
Source File: c:\***.cs Line: 834
Stack Trace:
[COMException (0x80010108): The object invoked has disconnected from
its clients.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers,
Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters) +435
...."
Again, any help would be greatly appreciated! Thanks!
Regards,
Robin Dindayal, BMath
Systems Developer
Intellitech Innovations Inc.
[email]robin@robindindayal.com[/email] (Robin Dindayal) wrote in message news:<f4052305.0307231307.517ac64d@posting.google. com>...> Does anyone know how I can print a fully rendered .aspx to the
> server's printer? I know that, if I wanted to print to the client's
> printer it would be easy (ie. use javascript's window.print()).
>
> However, I need to print to the server's printer. I need to print the
> fully rendered .aspx page from the codebehind .aspx.cs page to the
> server's printer.
>
> I've tried using SHDocVw.InternetExplorer and SHDocVw.WebBrowser but I
> just can't seem to get it to work. Any help with this would be
> greatly, greatly appreciated!
>
> Thank you!
>
> Regards,
> Robin Dindayal, BMath
> Systems Developer
> Intellitech Innovations Inc.Robin Dindayal Guest



Reply With Quote

