473,327 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Printing from a Web Method

I have a web method that renders a SQL Reporting Services report and prints
it to a network printer using the System.Drawing and System.Drawing.Printing
namespaces in .Net 2.0. This method has been working without issues in
production at several client sites but now I've started seeing memory errors
when trying to print. The only way to resolve the errors has been to do an
IISReset on the web server hosting the web service. I tried calling
Microsoft support for assistance in troubleshooting the issue and found out
that using System.Drawing in an ASP.Net application, ASP.Net Web Service and
in a Windows Service is not supported. Does anyone have any alternative ways
to print from a web service to a network printer? I'm trying to find a
managed code way of doing this but I'm not finding anything but
System.Drawing.Printing.

Thanks for the help.

Mark
Aug 21 '07 #1
3 2762
"Mark624" <Ma*****@discussions.microsoft.comwrote in message
news:6B**********************************@microsof t.com...
>I have a web method that renders a SQL Reporting Services report and prints
it to a network printer using the System.Drawing and
System.Drawing.Printing
namespaces in .Net 2.0. This method has been working without issues in
production at several client sites but now I've started seeing memory
errors
when trying to print. The only way to resolve the errors has been to do
an
IISReset on the web server hosting the web service. I tried calling
Microsoft support for assistance in troubleshooting the issue and found
out
that using System.Drawing in an ASP.Net application, ASP.Net Web Service
and
in a Windows Service is not supported. Does anyone have any alternative
ways
to print from a web service to a network printer? I'm trying to find a
managed code way of doing this but I'm not finding anything but
System.Drawing.Printing.
My suggestion would be to not print from a Web Service! Instead, write a
Windows Service, and queue the request to the Windows Service.

Unless you are printing asynchronously, you are tying up a worker thread for
as long as it takes to print the file over the network. I hope you don't get
too many simultaneous requests!
--
John Saunders [MVP]

Aug 21 '07 #2
Hi John,

Thanks for the response! The thought of using a Windows Service crossed my
mind too as an alternate but that is not supported either. Any other
thoughts? My only other idea so far is to write a console application that
does the printing and have my web method start the console app with the
appropriate parameters. It just seems like there has to be a better way.

Thanks for any ideas!

Mark
Aug 22 '07 #3
"Mark624" <Ma*****@discussions.microsoft.comwrote in message
news:3F**********************************@microsof t.com...
Hi John,

Thanks for the response! The thought of using a Windows Service crossed
my
mind too as an alternate but that is not supported either. Any other
thoughts? My only other idea so far is to write a console application
that
does the printing and have my web method start the console app with the
appropriate parameters. It just seems like there has to be a better way.
Another set of alternatives would be to use either .NET Remoting or Windows
Communications Framework (WCF) to talk to a "Windowless" Windows Forms
application. This would be a normal Winforms application except that it
would not display its form. Both Remoting and WCF can be hosted in this sort
of application.

The question for your Microsoft contacts is whether or not the window is
required for printing to be supported, or if it only needs to be in a
Windows Forms application.
--
John Saunders [MVP]

Aug 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: alb120 | last post by:
I implementing Internet Printing; but it fails: http://w23ksv/printers/ gives error on EI Version 6.0.2800.1106 (XP) "Server object error 'ASP 0193 : 80020009' OnStartPage Failed...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
10
by: Jeff B. | last post by:
Has anyone come across a decent algorithm for implementing word wrap features in .net printing? I have a small component that uses basic printing techniques (i.e. e.Graphics.DrawString in a...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
1
by: Dreamtime | last post by:
Hi I am using Visual Studio 2005 and the bundled Crystal Reports (previously I used .net 2003 and bundled Crystal Reports for 2 years - same issues!) I have a report which is displayed in the...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
6
by: randy1200 | last post by:
I'm using Visual Studio 2005 and C#. I need to print a WinForm used for data entry as a graphic. In other words, I need to print the exact WinForm the user sees on the screen. I searched through...
6
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.