Table of Contents

Client-Print

Together, client-print and service-print make up the direct print solution. This is a walkthrough of how you install and use the client-print feature.

For an overview of what client-print and service-print are and when to use what, you should go to this page:

Service-print vs. client-print

Installation

After downloading the installer, you can run it and select the component for client-print.

Install client-print

The client-print client must be installed on all the workstations using the client-print features.

Unattended installation

You can automate the installation of the Direct Print Client. To do this, specify the correct component and ask the installer to run unattended using the /SILENT or /VERYSILENT command line switch.

The following is an example of a command line:

ReportsForNAV_6_2_0_2213.exe /COMPONENTS="deployment/print" /SILENT

Create a direct printer

After the print client is successfully installed, it is time to set up a printer definition in Business Central. For standard client-print, you must define a printer that does not queue the jobs. Instead, it will create a download file for the client-print client.

Define a direct printer

The screenshot below shows a direct printer for client-print. It will send the print job to the user's default Windows printer.

Direct printer for user's default printer

When a direct printer is defined, it will automatically appear in the printer list.


Direct printer for user's default printer

Open .fornavprint file automatically

The Business Central browser client starts a download of a file with the .fornavprint extension. This is the file that your locally installed print client uses to print the document.

Your print client program is associated with the file extension fornavprint, meaning that Windows chooses the print client for the job if you open this file type. You can tell your browser to open these files automatically after the download. This will fully automate your print process.

Right-click the download file and choose "Always open files of this type."

Allways open files of this type

Error handling

If the print client cannot find the local printer specified in the print job file, it shows the user a dialog listing all the available printers. You can choose a printer from this list and print the job.

Since the introduction of the browser-based web client, downloading multiple files in one action has been problematic. This has been a problem for client printing because it relies on the ability to download a file with a specific file name extension. One example of an action that requires multiple print jobs could be printing both an invoice and a shipping document. If both these print jobs were to be downloaded, then one of them would be lost.

With the release of the ForNAV Customizable Report Pack 7.1, it is now possible to use client-print with multiple documents created in the same action. This is possible because the client-print feature can now use the ForNAV print queue in Business Central. The print queue was initially thought to be used for the service print, but now it can be used for both.

Direct printers on-hold

As shown in the screenshot above, you can create a client printer, select Queue Jobs, and set the initial status to On Hold. If you are using both client-print and service print in the same Business Central tenant, the direct print service will pick up only jobs with the status Ready. When printing to the new printer called Client Printer, the jobs will be placed on the queue instead of being downloaded as a regular client print job would be. Whenever you are ready to print the saved jobs, you can call a line of code that collects all the jobs in the queue that belong to your user’s session. The ForNAV code will then create a zip archive with all the jobs and download that as a client print file. Here is an example that shows how to create an action that downloads waiting print jobs.

action(DownloadMyOnHold)
{
    ApplicationArea = All;
    Image = Download;
    Caption = 'Download MY print jobs on hold';

    trigger OnAction()
    var
        pq: Record "ForNAV DirPrt Queue";
    begin
        pq.DownloadPrintJobs();
    end;
}

The essence of this code is the call to DownloadPrintJobs, which collects all the jobs on hold for the current user session. In theory, you could modify the current selection of jobs by setting a filter on the record for the print queue in the example. You can also collect the jobs automatically after your action is done printing them. Here is how you could use the DownloadPrintJobs procedure with an event handler that runs after all actions on a page.

[EventSubscriber(ObjectType::Page, Page::"ForNAV Reports", 'OnAfterActionEvent', 'Run', true, true)]
local procedure MyOnAfterActionEvent()
var
    pq: Record "ForNAV DirPrt Queue";
begin
    pq.DownloadPrintJobs();
end;

Using the method described here extends the use of client printing and removes one of its downsides compared to service printing. You can still use simple client print, where you create a direct printer without the queuing option. This is still somewhat easier if you only print one document at a time.