Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

Auto PDF Printing from a Scheduled Task.

Posted on by Microsoft Employee

Afternoon all,

I am running into a problem with auto printing PDFs from Dynamics SL.  The application I have written runs as expected when executed normally ( double clicked ), PDFs are printed, everything is great.  When I attempt to run the app from a scheduled task, ROI.exe is erroring out with a FileNotFoundException.    Below is my code for the starting of the process ( C# ).  The location that I am printing to is a network location... what I can't figure out for the life of me is why it would run perfectly fine one way, and not the other.

//Save the PDF
Process myProcess = new Process();
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.FileName = slDir + "ROI.exe";
myProcess.StartInfo.Arguments = "0 "
+ report.r.report.Trim() + "/run "
+ report.r.report.Trim() + "/format "
+ report.r.whereclause.Trim() + "/where "
+ "0/expformat "
+ @report.r.exportdirectory.Trim() + "Test\\" + pdfFileName + "/expfilename";

myProcess.StartInfo.CreateNoWindow = false;
myProcess.Start();

*This post is locked for comments

  • Apps Mexico Profile Picture
    Apps Mexico 1,090 on at
    RE: Auto PDF Printing from a Scheduled Task.

    Hi,

    Did you try do the same thing but with a vbtools screen, using the SL SDK?

    You can use the vbtools functions to call the ROI.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans