How to print from a Web Service
Posted on 2010-09-01
I have a web service created in VB.Net that is used by a handheld to instantiate and call methods so that the server is doing all the major processing and not the whimpy ARM processor on the handheld.
Anyways, when all the data crunching/ capturing is complete I want to be able to automatically print out the results to a nearby printer. I do this with a seperate class contained in the Web Service. It uses a .rdlc with no report viewer.. simply sends straight to the printer.
Debugging the Web Service locally works like a charm, but when I publish to the server hosting IIS and call the same print method it comes back with Success, but never any print out.
Also, there are no errors ever returned. I still believe this is some kind of permission issue, not an issue with the code.
Here is a list of the things I have done to try getting this to work:
1) Run the Web Service in an application pool with the identity of network user SQLAdmin
2) Logged into the server as SQLAdmin and installed the printer and set it as default
3) Made sure that SQLAdmin is part of the IIS Worker process group
4) Tried using Impersonation in the Web.config for SQLAdmin
5) Tried a registry hack from Microsoft - changing HKEY_CURRENT_USER to HKEY_USERS\.Default
6) Modified .Net framework on the server for Full Trust
7) Set IIS to allow Scripts/Executables (btw.. this is internal to our organization, not open to the public, or else I would tighten security)
Any further ideas would be most helpful.
Also, I didnt post any code due to the size of this original post.
If you feel that it might be a coding issue, just holler and I'll post the Print class