printer selection based on document location

drieszendrieszen Member Posts: 12
edited 2004-12-24 in Navision Attain
I want to print for example the delivery note on a printer that is automaticaly selected based on the location on the sales header. In my situation, an employee prints the document in different warehouses (the printer selection does not work in this case).

Problem: The function findprinter (cu1) is called before the document is printed, so the location on the document can not be used. How can I influence the printer after the selection screen of the report

Comments

  • ArhontisArhontis Member Posts: 667
    First try the Printer Selection under General Ledger->Setup.

    That way you can set a default printer for a user and a specific report.

    You could enter a new line to that table with the username, the printer you want and the report ID, before printing the report, so when the report tries to print to find the specific printer.

    After the report is printed, you can delete that temporary line in the printer selection table.

    I haven't tried it. If you encounter a problem, post me to try it.
  • drieszendrieszen Member Posts: 12
    that already helps, i didn't think about that solution.

    But it is not a final solution, because I want to select the printer after I started the report (for example after the first dataitem).
  • PoebblesPoebbles Member Posts: 35
    :idea:
    For my opinion it is not possible to select a Printer after a Report was started
    But try the following: Add in the Location a new field with Table Relation to the Printer Selection.
    If a report is started, then either the Codeunit 1 is used or a function in the Posted Documents is running.
    Determine all Location Codes existing in the Document and fill a temporary table. Subsequently, run over this temporary table and convert the PrinterSelection in the Codeunit 1 before the User and Report is selected.
    Merry X-mas
  • drieszendrieszen Member Posts: 12
    I also thought about that, but I was curious if anyone had another solution.
  • pdjpdj Member Posts: 643
    We had the same problems parsing parameters to the FindPrinter function in codeunit 1. We solved it by making a SingleInstance codeunit that we call before starting the report. Then you can modify FindPrinter to get the parameters from the SingleInstance codeunit. It works ok.
    Regards
    Peter
  • drieszendrieszen Member Posts: 12
    thanks!!
Sign In or Register to comment.