Change System Printer

Emerik
Member Posts: 50
Hi all,
I've been searching the forum for a solution to my problem.
I have a report, I would like to print with a PDF-printer.
I do not want Navision to prompt me for a choice of printer. I want to change the System Printer to the PDF-printer, print the report without request forms or other user intervention and restore the system printer settings afterwards. Is there any way to do this?
BTW, any recommandations for a free PDF-printer, which is flexible and highly configurable from Navision code?
Thanks in advance.
/Emerik
I've been searching the forum for a solution to my problem.
I have a report, I would like to print with a PDF-printer.
I do not want Navision to prompt me for a choice of printer. I want to change the System Printer to the PDF-printer, print the report without request forms or other user intervention and restore the system printer settings afterwards. Is there any way to do this?
BTW, any recommandations for a free PDF-printer, which is flexible and highly configurable from Navision code?
Thanks in advance.
/Emerik
0
Comments
-
You can go to the Printer Selections form and setup reports and printers to use per user (all blank for all users...).0
-
Is it possible with C/AL code to decide which printer to use? Or to change the System Printer? If there is, I'm also looking for that way to do it.0
-
I think that when you run a report Function FindPrinter(ReportID) in Codeunit 1 is executed. So the only thing you would have to do would be (also in code) to play around with the UseReqForm,UseSystemPrinter and the other properties in the report...0
-
Emerik wrote:Hi all,
I've been searching the forum for a solution to my problem.
I have a report, I would like to print with a PDF-printer.
I do not want Navision to prompt me for a choice of printer. I want to change the System Printer to the PDF-printer, print the report without request forms or other user intervention and restore the system printer settings afterwards. Is there any way to do this?
BTW, any recommandations for a free PDF-printer, which is flexible and highly configurable from Navision code?
Thanks in advance.
/Emerik
You can change the users default printer by running this with 'Windows Script Host Object Model'.WshShell:rundll32 printui.dll,PrintUIEntry /y /n "Your Printer Name"
After print out you have to change it back.
Hope this will help!0 -
You can change the users default printer by running this with 'Windows Script Host Object Model'.WshShell:
rundll32 printui.dll,PrintUIEntry /y /n "Your Printer Name"
After print out you have to change it back.
Cool!
Is there some way of telling me the name of the default printer, before I change it? If I have to change back the printer, I would need to know what it was before, I changed it. It can be various different printers depending on the user.0 -
Emerik wrote:Cool!
Is there some way of telling me the name of the default printer, before I change it? If I have to change back the printer, I would need to know what it was before, I changed it. It can be various different printers depending on the user.
Sorry, but I've got no good solution for that. I solved it by adding a field to table User Setup, "Default printer name".
But please share if you find a nice way to find out which printer is the default printer for the logged in user.0 -
-
Thanks garak!
I guess I didn't manage to use the search function earlier... :oops:0 -
No prob, you're welcomeDo you make it right, it works too!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