Webservice Print Problem

stony
Member Posts: 122
I have a C # program which makes bookings in Navision (via web service). Everything works very well.
This program is used by about 30 computers. These bookings will also print a label. And sometimes I have problems with that. The code for this print is the following:
CLEAR(WarehouseEntry);
PDFFilename := "3TierMgtm".ServerTempFileName('pdf');
WarehouseEntry.RESET;
WarehouseEntry.SETRANGE("Lot No.",Chargennr);
IF WarehouseEntry.FINDFIRST THEN BEGIN
REPORT.SAVEASPDF(50084, PDFFilename, WarehouseEntry);
Path := PDFFilename;
GetPathFilename(Path, FileN);
CLEAR(PrinterSelection);
IF PrinterSelection.GET(USERID, 50084) THEN;
Printing.PrintPDFFoxitReader(Path + FileN, PrinterSelection."Printer Name");
END;
And PrintPDFFoxitReader-Function
PrintPDFPDFtoPrinter(FileName : Text[250];Printer : Text[100])
PDFtoPrinter := 'C:\PDFtoPrinter\PDFtoPrinter.exe';
StartProcess(PDFtoPrinter,STRSUBSTNO('"%1" "%2"',FileName,Printer));
StartProcess(FileName : Text[250];Arguments : Text[250])
Process := Process.Process();
ProcessInfo := ProcessInfo.ProcessStartInfo(FileName,Arguments);
//ERROR('%1 %2',FileName,Arguments);
Process.StartInfo := ProcessInfo;
Process.Start();
This works partially without problems for several weeks, but suddenly nothing works. Say nothing is printed but the bookings are working. The problem can also occur several times a day. There are several PDFViewer processes on the tier server when this problem occurs. You can not finish these Processes. And even a restart of the Navision service does not solve the problem. I always have to restart the server to make it work again.
Do you have an idea how I could solve it or how do you print via web service?
I'm currently using PDFtoPrinter, but had the same problem with FoxitReader. Use Navision 17 with CU12.
Thank you very much
stony
This program is used by about 30 computers. These bookings will also print a label. And sometimes I have problems with that. The code for this print is the following:
CLEAR(WarehouseEntry);
PDFFilename := "3TierMgtm".ServerTempFileName('pdf');
WarehouseEntry.RESET;
WarehouseEntry.SETRANGE("Lot No.",Chargennr);
IF WarehouseEntry.FINDFIRST THEN BEGIN
REPORT.SAVEASPDF(50084, PDFFilename, WarehouseEntry);
Path := PDFFilename;
GetPathFilename(Path, FileN);
CLEAR(PrinterSelection);
IF PrinterSelection.GET(USERID, 50084) THEN;
Printing.PrintPDFFoxitReader(Path + FileN, PrinterSelection."Printer Name");
END;
And PrintPDFFoxitReader-Function
PrintPDFPDFtoPrinter(FileName : Text[250];Printer : Text[100])
PDFtoPrinter := 'C:\PDFtoPrinter\PDFtoPrinter.exe';
StartProcess(PDFtoPrinter,STRSUBSTNO('"%1" "%2"',FileName,Printer));
StartProcess(FileName : Text[250];Arguments : Text[250])
Process := Process.Process();
ProcessInfo := ProcessInfo.ProcessStartInfo(FileName,Arguments);
//ERROR('%1 %2',FileName,Arguments);
Process.StartInfo := ProcessInfo;
Process.Start();
This works partially without problems for several weeks, but suddenly nothing works. Say nothing is printed but the bookings are working. The problem can also occur several times a day. There are several PDFViewer processes on the tier server when this problem occurs. You can not finish these Processes. And even a restart of the Navision service does not solve the problem. I always have to restart the server to make it work again.
Do you have an idea how I could solve it or how do you print via web service?
I'm currently using PDFtoPrinter, but had the same problem with FoxitReader. Use Navision 17 with CU12.
Thank you very much
stony
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions