Windows 10 printerselection

henningth@hotmail.com
Member Posts: 10
NAV2009 classic - have used the classic method used by many - in codeunit having a printerselection by name and when job is done then restore the printer.
IN Windows 10 - the selected printer (spec. PDF printer) then becomes the default printer and stays there until you manually alter it in the control panel.
Testing with Windows 7 this is not the case - the original default printer stays as the default.
Cannot figure out why - anybody having an idea?
IN Windows 10 - the selected printer (spec. PDF printer) then becomes the default printer and stays there until you manually alter it in the control panel.
Testing with Windows 7 this is not the case - the original default printer stays as the default.
Cannot figure out why - anybody having an idea?
0
Answers
-
I dont know about the function, which you use, but if the windows standard printer is changed, then you doing something wrong.
Normally you create a single instance codeunit - set the alternative printer there and then get the alternative printer in CU 1 and skip the printer selection one time. Also you have to reset the saved printer in the single instance cu.
Then you have a changed printer for a single print job!0 -
What happens when you do this directly on the server?0
-
The code looks like this - 2 funktions in codeunit to handle it (Select printer by name and RestorePrinterSelection:
SelectPrinterByName("User ID" : Code[20];"Report ID" : Integer;"Printer Name" : Text[30])
PrinterTable.SETFILTER(Name, '@' + "Printer Name", "Printer Name");
IF PrinterTable.FIND('-') THEN
BEGIN
//Store old selection.
PrinterRestoreUserID := "User ID";
PrinterRestoreReportID := "Report ID";
IF PrinterSelection.GET("User ID", "Report ID") THEN
BEGIN
PrinterRestorePrinterName := PrinterSelection."Printer Name";
BoolInsert := FALSE;
END ELSE
BEGIN
PrinterRestorePrinterName := '';
PrinterSelection.INIT;
PrinterSelection."User ID" := "User ID";
PrinterSelection."Report ID" := "Report ID";
BoolInsert := TRUE;
END;
PrinterSelection."Printer Name" := PrinterTable.ID;
IF BoolInsert THEN
PrinterSelection.INSERT
ELSE
PrinterSelection.MODIFY;
END ELSE
BEGIN
ERROR(STRSUBSTNO(Text033, "Printer Name"));
END;
And then the restore part:
RestorePrinterSelection()
IF PrinterRestorePrinterName <> '' THEN
BEGIN
IF PrinterSelection.GET(PrinterRestoreUserID, PrinterRestoreReportID) THEN
BEGIN
PrinterSelection."Printer Name" := PrinterRestorePrinterName;
PrinterSelection.MODIFY;
END;
END ELSE
BEGIN
IF PrinterSelection.GET(PrinterRestoreUserID, PrinterRestoreReportID) THEN
BEGIN
PrinterSelection.DELETE();
END;
END;0 -
This is a Windows 10 feature. It can be turned off in Settings > Devices > Printers & Scanners > Let Windows manage my default printer
Actually, this could be regarded as an incompatibility between NAV and Windows 10. The automatic default printer switch should only work if the user manually selects a different printer, in my opinion.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