I'm currently working on a C# 2010 service that collects a text file from a folder, creates an Excel file from it and saves this file. The txt data is correctly read, processed and the Excel files is stored as it should. However, I need to add print ranges in the excel sheet. This is where my service returns an exception.
The problem probably is that a service runs underneath the system account. Since a printer (that is not shared) is user dependent, meaning the system account wont have printers installed.
To implement this, how can I do this? - How can the service add a printer to the system account? - Would it work with the Microsoft XPS printer? - If it cannot be done by the XPS printer, how can I add another printer. We don't have a print server, so everyone has to install the drivers locally for the network printer. How can I add a (network) printer to the system account and use the correct driver?
The excel files are created on and printed from the same computer. Creation is underneath the system account, printing underneath a user account.
Thanx in advance!!!
Jan