Hello,
we have some Navision Users that are connected directly to a computer via terminal server. Terminal server creates a "session x" of different printers of clients when they're logged in.
For example:
Client 1 have 2 local printers installed. When it's logged in to Terminal SErver, TS adds these 2 printers to the server with a session id.
Client 2 have 2 local printers installed, too. When it's logged in to TS, TS adds these 2 printers to the server with another session id...
..and so on...
The problem is that I assign these printers to various users using Printer Selection to print various reports directly for selected printer. However, nothing is printed when I do some process that runs this report. I'm running the report using FALSE in RUN(..,..,SystemPrinter).
I can print reports for the printers added to TS if I run the report with Preview form but I need to print directly these reports without preview form. So, I don't know what's the problem.
Thank you.
Answers
The other option is that to add the printers to printer selection from logging into terminal services.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Invoice Datamax M-4206/PC01/Session 5
Define printers while session is active.
Thank you!!!
Code above works for Win2003 or earlier. On Win2008, sessions and printer names are different.
To determine which session is logged in, it is in TEMP variable
I use an automation because there is a known bug with the printer detection.
Apparently if you login to Navision RTC within a few seconds after login via terminal service, your system will not detect all the redirected printer. Or course if you can train you users to wait n seconds before login to Navision (where n is = number of redirected * 3), or ask them to use classic Navision then the automation is not needed.
In Codeunit 1,
Name DataType Subtype Length
WshNetWork Automation 'Windows Script Host Object Model'.WshNetwork
//AX001 - Start
IF STRPOS(PrinterSelection."Printer Name",'redirected') > 0 THEN
BEGIN
CREATE(WshNetWork,FALSE,TRUE);
i := 1;
REPEAT
IF STRPOS(WshNetWork.EnumPrinterConnections.Item(i),'ZDesigner ZM400 200 dpi') > 0 THEN BEGIN
EXIT(WshNetWork.EnumPrinterConnections.Item(i));
END;
i := i + 1;
UNTIL i = WshNetWork.EnumPrinterConnections.Count;
END
ELSE
//AX001 - End
EXIT(PrinterSelection."Printer Name");