2

I have my web page published in hosting, and I cant print my reports because (I tink) my web application can`t get my printer name.

An Idea please.

Thanks a lot.

AndresC9
  • 39
  • 3

1 Answers1

0

use web config file to set your printer name. use this name in printer settings.

<add key="PrinterName" value="\\192.168.1.1\Canon LBP6000/LBP6018" />

in c#

 PrintDocument printDoc = new PrintDocument();
 string printerName = WebConfigurationManager.AppSettings["PrinterName"];
 printDoc.PrinterSettings.PrinterName = printerName; 

did work for me .

Anupam Roy
  • 1,654
  • 2
  • 18
  • 25