No printers are installed after publish in IIS server

samsmuthu
 
on Apr 16, 2021 10:41 PM
1554 Views

Hi dharmendr,

Thank you for the code sample and worked well.

PrintPageEventHandler is an event and so cannot be called directly

After publish to my IIS server and when i going to print my local pc printer shown below error.

No printers are installed

So i have a requirement in printing my local pc printer.

Please help me to fixed above issue.

Thanking you

SAMSMUTHU

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Apr 16, 2021 10:42 PM

I will get back to you soon.

dharmendr
 
on Apr 16, 2021 11:48 PM

Hisamsmuthu,

When you use PrintDocument.Print() you are printing on the server. When you deploy your application in IIS this printing will happen on the server computer that is hosting your application.

You cannot print directly to the client computer from a web application. The best you could do is provide some HTML document using a print media CSS type. Then if the user decides, he might print it in his browser.

When you publish your website to a server, it does not have any printer installer and that's why you get such error. Your code is trying to print to a printer installed at the server not at the client.

If you want to print the report to client printers, then try below article.

Print RDLC Report without Print Preview using JavaScript in ASP.Net