Single report to multiple printers

Hi ALl,

I have 5 machines with a 3rd part application installed which triggers a particular report from NAV server. My requirement is from whichever machine the report is triggered, print should be populated from the respective printer attached to it. Is it possible in NAV 2016

Answers

  • TallyHoTallyHo Member Posts: 417
    edited 2019-11-04
    I presume the third party app consumes a NAV webservice.
    use something like the CreatePrintJob function below in the NAV webservice codeunit.
    Configure the job queue to run, and you'll be able to send to different printers bij executing
    the CreatePrintJob function through your webservice. The pUserId should be different for each machine. The users have to be valid users in NAV, and the report should be configured to print on a specific printer for that user using the printer settings in NAV.

    pRunInUserSession := true; !!

    CreatePrintJob(pRecRef : RecordRef;pUserId : Code[50];pObjectID : Integer;pCategory : Code[10];pNotify : Boolean;pRunInUserSession : Boolean)
    //3=report,5=CU
    JobQueueEntryLRec.ID := CREATEGUID;
    JobQueueEntryLRec."User ID" := pUserId;
    JobQueueEntryLRec."Timeout (sec.)" := 7200;
    JobQueueEntryLRec."Object Type to Run" := 3;
    JobQueueEntryLRec."Object ID to Run" := pObjectID;
    ObjectTable.SETRANGE(Type,JobQueueEntryLRec."Object Type to Run");
    ObjectTable.SETRANGE(ID,JobQueueEntryLRec."Object ID to Run");
    IF NOT ObjectTable.FINDFIRST THEN
    CLEAR(ObjectTable);
    JobQueueEntryLRec."Record ID to Process" := pRecRef.RECORDID;
    JobQueueEntryLRec.Description := COPYSTR(STRSUBSTNO('%1 %2 %3',ObjectTable.Type,ObjectTable.ID,ObjectTable.Name),1,MAXSTRLEN(JobQueueEntryLRec.Description));
    JobQueueEntryLRec."Job Queue Category Code" := pCategory;
    JobQueueEntryLRec."Notify On Success" := pNotify;
    JobQueueEntryLRec."Maximum No. of Attempts to Run" := 3;
    JobQueueEntryLRec."Run in User Session" := pRunInUserSession;
    CODEUNIT.RUN(CODEUNIT::"Job Queue - Enqueue",JobQueueEntryLRec);
  • krikikriki Member, Moderator Posts: 9,115
    [Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.