Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

PrintToPrinter doesn't work when printing from a windows service in a virtual machine

$
0
0

I have created a window service that will process reports and then call the PrintToPrinter to print them on a specified printer. The service prints the reports if the service runs on a local machine but it doesn't print the reports when it runs on a window virtual machine. FYI, It doesn't throw any exceptions. I've been searching for reasons/solutions but haven't found anything. Please advise. Below is the code that I use.

 

public void PrintReports(string printer)

{

     try

     {

          GetReportDocument().PrintOptions.PrinterName = printer;

          GetReportDocument().PrintToPrinter(new PrinterSettings { PrinterName = printer }, new PageSettings(), false);

     }

     catch(Exception e)

     {

          ................

     }

}


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>