I try to print from web service using the below command
oRpt.PrintOptions.PrinterName = "\\ipaddress\printername"
oRpt.PrintToPrinter(1, False, 1, 1)
I got "Invalid printer specified"
I could print out any word document but in programming could not.
Please share me. Thank you.
You need to make sure that the printer is installed and the permissions are set for the Identity that the service uses.
The simplest thing to do is to log into the app server that runs your web service, using the same Identity that the web service runs under. If it is running under IIS this would be the Identity that the application pool uses. Then you will probably have to install the printer (as a network printer) and print a test page. We created a service that was dedicated for printing and created an AD account specifically for it to run under. You will likely need to continue to use the fully qualified printer name and not the name that the printer was installed as, but that may depend on the application you are using to print.