How to Distribute Reports after Successful .qvw Reload on a QlikView Server with Publisher
To execute this tutorial you must have QlikView Server and Publisher installed and running. You need also NPrinting Server. Of course, you need related licenses.
In this tutorial you'll learn how to schedule the reload of a .qvw in QlikView Server and then distribute reports based on it by using NPrinting only if the reload finished successfully.
This is an advanced tutorial that requires a good knowledge about developing solutions using NPrinting. We'll use examples from the NPrinting Training environment.
Configure your source documents
Copy SalesDemo.qvw in the Source Documents folder (for instance C:\ProgramData\QlikTech\SourceDocuments)
Log in the QMC (QlikView Management Console) and you'll see the .qvw in the "Source Documents" tab under "Documents"
Create a QlikView Server Reload Task
Click on the green "+" (plus) symbol on the upper right corner of the QMC to add a task
Insert "Sales Demo Reload" as name.
Distribute the Reloaded Document to a Folder
In the "Distribute" tab set C:\ProgramData\QlikTech\Documents as distribute folder and select "All Authenticated Users" in the drop-down menu. Use this document in the source connection of the NPrinting project.
Trigger the Reload
Open the "Triggers" tab
Create a schedule based trigger
Confirm by pressing "Apply" and try to manually run the trigger to be sure that everything is ok
Set NPrinting Service to Accept External Requests
Open the NPrinting Management Console
Enable the external requests flag
Insert the Source Folder. For instance C:\NPrintingTraining\ExternalRequestsXML
It will rename the QVS.processed file to QVS.request. When the NPrinting Server find a .request file in the External Requests folder it will execute it.
Open the External Program in QlikView Server
Select the "System" tab
Click on "Supporting Tasks"
Activate the "External Program" folder
Click on the green "+" (plus symbol) button on the right corner to create a new task
Create a new Task
Set "Send NPrinting Reports" as task name
In the "Command line statement" insert C:\NPrintingTraining\ExternalRequestsXML\QVS.bat.
When activated this task will run the script we saved in QVS.bat
Trigger the Task
Click on the green "+" (plus symbol) button to create a new trigger
In the Start the task drop-down menu select "On event from another task"
Set "successful" on Start on
On Completion of set "Sales Demo Reload"
In this way you'll trigger the task to start after the finish of the reload and only if it ended successfully. This task runs the QVS.bat file who rename QVS.processed to QVS.request so NPrinting Server starts to distribute the reports.