Options

Webservice Print Problem

stonystony 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
Sign In or Register to comment.