Skip to Content
0
Former Member
Oct 02, 2009 at 02:29 PM

.Net Service - printing a CR-Report

26 Views

HI,

i am using VisualStudio2008 to create a windows-service. (C#)

This service

- creates a PDF document by CReports

- should print a CR-Report to a named printer.

Creating the PDF works fine, but printing does not!

crypt.PrintOptions.PrinterName = printerName;

does not work. I always get the message "printer not found" at this point in the debugging-process.

The printername is verified to be correct (its in System.Drawing.Printing.PrinterSettings.InstalledPrinters).

This all works if i start the software that should print directly from my desktop.

If i start it from the service it is giving me above error ("printer not found");

I already tried starting the printing-program as "myUser" and the service does use "myUsers"-account to run.

Any help here?

THX in advance,

Markus

edit: to clarify the program flow:

(external action) -> service -> starts reporting software -> creates both PDF (works) and prints (which does not work)

Edited by: Cumulus7 on Oct 2, 2009 4:36 PM