Re: Printing from an ASP.NET page
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng [MSFT])
- Date: Thu, 17 Jul 2008 06:32:50 GMT
Thanks for your reply Brett,
Yes, webservice or even simple network socket programming is ok(or if you
can use .net 3.0, WCF will be much more convenient). Also, if you are
familar with MSMQ programming, you can consider make each print request as
a MSMQ message and send to a message queue, and your target winform
application constantly pick messages from queue and perform printing.
For the console application, do not call it from your ASP.NET application,
that way, you are doing the samething as you try calling winform printing
code in asp.net application since that will make the consile running in the
same user context of the ASP.NET web applicaction. You should run the
console or winform application from a logon user context and let the
asp.net application communicate it via some remote communication methods.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Brett" <brettlf@xxxxxxxxxxxxxxxx><e#FIbdw4IHA.4688@xxxxxxxxxxxxxxxxxxxxxx>
References: <OxehiRt4IHA.1428@xxxxxxxxxxxxxxxxxxxx>
<OC0d#f14IHA.832@xxxxxxxxxxxxxxxxxxxx>
<5AVjijV5IHA.1624@xxxxxxxxxxxxxxxxxxxxxx>
<#DVj5Nf5IHA.1420@xxxxxxxxxxxxxxxxxxxx>
<L2FYPQi5IHA.5840@xxxxxxxxxxxxxxxxxxxxxx>
<#NtMCWr5IHA.1592@xxxxxxxxxxxxxxxxxxxx>
<sOBPTRv5IHA.4500@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Printing from an ASP.NET page
Date: Wed, 16 Jul 2008 16:34:12 -0400
but
Yes, I could run the printing part as a Winform application. I'm not sure
how I should implement it. (.NET remoting? Web service?) The
communication between applications would be a new area for me.
I found an article on MSDN that shows how to use a console application to
print a local report without previewing it:
http://msdn.microsoft.com/en-us/library/ms252091(VS.80).aspx
When I ran the console application , it successfully printed the report,
when I tried to call the console app from the web app, I got
"PrintLocalReport has encountered a problem and needs to close."
Error signature:
EventType : clr20r3 P1 : printlocalreport.exe P2 : 1.0.0.0
P3 : 487e4d71 P4 : mscorlib P5 : 2.0.0.0 P6 : 471ebc5b
P7 : 3404
P8 : d8 P9 : system.io.filenotfoundexception
The following code fails at "Dim p As System.Diagnostics.Process."
Dim filePath As String = Server.MapPath("PrintLocalReport.exe")
Dim info As System.Diagnostics.ProcessStartInfo = New
System.Diagnostics.ProcessStartInfo(filePath, "")
info.UseShellExecute = False
Dim p As System.Diagnostics.Process =
System.Diagnostics.Process.Start(info)
p.Start()
I don't know what file was not found. I did a "File.exists(filepath)" and
it returned "True"
.
- Follow-Ups:
- Re: Printing from an ASP.NET page
- From: Brett
- Re: Printing from an ASP.NET page
- References:
- Printing from an ASP.NET page
- From: Brett
- RE: Printing from an ASP.NET page
- From: Steven Cheng [MSFT]
- Re: Printing from an ASP.NET page
- From: Brett
- Re: Printing from an ASP.NET page
- From: Steven Cheng [MSFT]
- Re: Printing from an ASP.NET page
- From: Brett
- Re: Printing from an ASP.NET page
- From: Steven Cheng [MSFT]
- Re: Printing from an ASP.NET page
- From: Brett
- Re: Printing from an ASP.NET page
- From: Steven Cheng [MSFT]
- Re: Printing from an ASP.NET page
- From: Brett
- Printing from an ASP.NET page
- Prev by Date: Re: Any article explains challenges and benefits of 64 bit asp.net server?
- Next by Date: RE: TreeView: Is there any way to specify NodeIndent property for a specific level
- Previous by thread: Re: Printing from an ASP.NET page
- Next by thread: Re: Printing from an ASP.NET page
- Index(es):
Relevant Pages
|
Loading