Select different printers for report

Christian_Buehl
Member Posts: 145
Does anyone know, how to manipulate the target printer.
The printerselection allows only to set alway the same printer for a report.
I want to choose between a pdf-printer and the regular printer.
As the printer is set in codeunit 1 there should be a way to select the printer dynamic (controlled by software).
Does anyone know how ?
The printerselection allows only to set alway the same printer for a report.
I want to choose between a pdf-printer and the regular printer.
As the printer is set in codeunit 1 there should be a way to select the printer dynamic (controlled by software).
Does anyone know how ?
0
Comments
-
As I think someone else is interested in a solution for this - I found a small (litttle bit dirty :P ) workaround for my problem, after I analyzed the ne-printer solution from BGI:
I insert a new record into the printerselection, print the record and remove it after the record was printed.PrinterSelection | Record | table 78 printer | record | table 2000000039 reporitid | Integer | number of report to print PDFPrintername | text 100 | Name of the Printer without ",NEx" -- printer.SETFILTER(Name,PDFPrintername); IF NOT printer.FIND('-') THEN ERROR('Printer %1 is not available\Please install first!', PDFPrintername); // First check if printer exist and delete if there is a preselection IF PrinterSelection.GET(USERID, reportid) THEN PrinterSelection.DELETE; PrinterSelection.INIT; PrinterSelection."Report ID" := reportid; PrinterSelection."UserID" := USERID; PrinterSelection.Printername := STRSUBSTNO('%1,%2',printer.Name,printer.device); PrinterSelection.INSERT; printdata.RESET; printdata.SETFILTER(printdata."Nr.",Rec."Nr."); REPORT.RUNMODAL(REPORT::Einkaufsbestellung ,FALSE,FALSE, printdata); PrinterSelection.DELETE;
0 -
Thanks for your code, it helped me much0
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