Reputation: 473
Have the need to nightly startup a process that creates PDF based Reports (Financial Charts). A past developer produced a component that uses System.Drawing and System.Printing to create and save the reports to a directory as a PDF using Amyuni. Now we would like to use that component to produce PDF off hours for analysts to use the next day. The actual graphs are custom drawn using GDI+ with DrawLine, DrawString, etc. Using the PrintPageEventArgs Graphics property as the canvas for the drawing.
Using the component works just fine from a Windows Forms application works just fine. When using the component running under a user account (not LocalSystem) so service has access to printers doesnt fail with any exceptions, but no files are created.
I know that System.Drawing and System.Printing not really supported from Windows Service, but supported doesnt mean doesnt work. Just means MS wont help you through issues.
Any idea what we can do to get this to work? This is not a high volume process. Currently they do it with a command line program and the Windows Task Scheduler, but that requires the user to be left logged in.
UPDATE: So I tried this as a .NET console application and started it with the Windows Task Scheduler and the same problem occurs. Run the console application from the desktop and it works. Run it from Task Scheduler it runs, but no files are created. I do have extensive logging going on an no exceptions are occurring and it sure looks like the process is creating the charts. They just arent showing up in the output directory. I setup the task to run under the same account that I am logged in as. The previous task that did work was a Visual Basic 6 solution not a .NET solution.
Upvotes: 2
Views: 629
Reputation: 10418
For future readers of this post, the issue described on this question was caused by licensing restrictions of Amyuni libraries on Windows Server operating systems (Amyuni Technologies provides several licensing models according to the applications being developed). For this particular case, new licensing information was provided after contacting Amyuni Support and the issue was resolved.
Disclaimer: I work for Amyuni Technologies.
Upvotes: 1