Report Printing

Hey Guys, Does anybody have any idea how to print a report on different printers. I know we can do this by doing printer selection. But that selection depends upon the userid. I am having a situation where i want to print the picking slip for the warehouse. where HO/Branch will process the picking list and prints it. But when they prints the picking list what I want is to print the picking slip on respected warehouses. Cheers Jagjeet

I think you’re going to have to come up with a procedure using the USER ID related feature. The only other option I can think of is to find an operating system feature for print routing that you can use (and I don’t know of one). Dave Studebaker Liberty Grove Software A Navision Services Partner

I have done this a few times for different resp. centers. If an invoice is posted in the HQ and must be printed in another resp center. You can do this with different solutions: 1. The easiest solution is to add a new field in the tabel report selection (for example “resp. center”)and add a filter in the codeunit “document-print”. a small example Usage prior resp center report id Sales invoices 1 50010 sales invoices 2 BXL 50011 Sales invoices 3 PARIS 50012 if you add this filter in the CAL code in codeunit “document print” “PurchHeader”.SETFILTER (“resp center”,’%1|%2’,PurchHeader.“resp center”,’’); Result : for resp center paris : report 50010 and 50012 for resp center bxl : report 50010 and 50012 for another resp center : report 50010 Of course, you have to make a different report for every resp center (this is normally not what we want, but sometimes if you must print to different old printers with different escape codes, … you have to) Second solution : this is the solutions I used if I import invoices from another system and they choose the printer on a random base. Add in first line in codeunit 1, in function Findprinter // GSS - NHA - 01069 - M0622 - 06/03/02 - First : search for user selections TmpPrinter := “Printer selection functions”.GetPrinter; IF (TmpPrinter <> ‘’) THEN BEGIN Printer.SETFILTER(Name,’%1’,’@’+TmpPrinter); IF Printer.FIND(’-’) THEN EXIT(Printer.Name+’,’+Printer.Device); END; where “printer selection functions” = codeunit with following code SetPrinter(Printer : Text[250]) User.“User ID” := GetUserID; User.“Print to Printer” := Printer; IF NOT User.INSERT THEN User.MODIFY; GetPrinter() : Text[250] IF User.GET (GetUserID) THEN EXIT (User.“Print to Printer”); RemovePrinter() IF User.GET (GetUserID) THEN User.DELETE; GetUserID() : Text[250] IF STRLEN (‘PRN’+USERID) <= MAXSTRLEN (User.“User ID”) THEN EXIT (‘PRN’ + USERID) ELSE EXIT (COPYSTR (‘PRN’+USERID,1,MAXSTRLEN (User.“User ID”))); so before you print a report, you can add following code before and after the report (again in codeunit document-print). Rec.SETRECFILTER; ReportSelection.SETRANGE(Usage,ReportSelection.Usage::“xxxxx”); ReportSelection.SETFILTER(“Report ID”,’<>0’); IF (Rec.“Print to” <> ‘’) THEN BEGIN “Printer selection functions”.SetPrinter(rec.“Print to”); ClearPrinter := TRUE; END; IF ReportSelection.FIND(’-’) THEN BEGIN REPEAT REPORT.RUNMODAL(ReportSelection.“Report ID”,FALSE,FALSE,Rec); UNTIL ReportSelection.NEXT = 0; IF (ClearPrinter) THEN BEGIN “Printer selection functions”.RemovePrinter; END; END; → so, in short terms : everytime I must print to a strange printer I add in the “user setup” tabel a fictive user (for example PRNNICO) and holds there the printer. After printing, I remove this fictive user. → it’s maybe strang that i created a second user (mostly all users are already created in the table “user setup”), but I had some problems with the non-existing users. I don’t know exactly anymore what it was. I hope this helps, Nico

There is a standard feature in the US version, located under GL/Setup/Printer Selections. It does exactly what you are trying to accomplish. Alex

I believe the problem here is for one user to be able to choose which (warehouse) printer to print the picking document on. The standard feature you refer to allows a predefined printer to be selected based on the UserID + ReportID, but not for a user to dynamically choose the target printer.