on 08-17-2006 2:59 PM
Hi everyone,
I want to send a file path from SAP/R3 to a Windows Service written in C#.
I do succeed sending the file path from SAP to the windows service but when I try to print the file, it does not work.
If I create a Console Application in C# and print the document using the same code that is in the windows service, it works perfectly.
Is there a difference between a windows service and a console application (background processing ???).
Thanks in advance.
Regards.
Hi David,
Could you please paste the fragment from your code where you are printing the file ?
Regards,
Rima.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rima,
Before you see the code, I just want to tell that this code work perfectly with concole application.
Here is the code :
public void PrintDoc(String File_Path)
{
Process myProcess = new Process();
try
{
myProcess.StartInfo.FileName = File_Path;
myProcess.StartInfo.Verb = "Print";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
}
catch (Exception e)
{
}
}
I've just tested the same code with a console application ruuning a SAP Proxy server and it work good.
The problem is that is a console app and not a windows service which is not so friendly for the end user.
Thanks.
Message was edited by: David Fryda
Hi David,
I would suggest you to throw an exception in the try ... catch block in order to investigate the problem:
try
{
your code
}
catch (Exception e)
{
throw e;
}
May be your service doesn't have a sufficient permissions to operate on the file. Check which user account used to run this service.
Regards,
Rima.
Message was edited by: Rima Rudnik-Sirich
Hi Rima,
When I get into the PrintDocument function, I do write to the EventLog but the it does not print.
As I told, the same code works with a Console Application.
The user who call the PrintDocument function is a super user with all the rights.
I thing that Windows Service cannot perform GUI stuff...and printing is a GUI stuff.
Thanks.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.