Qlik Community

Qlik NPrinting Documents

Documents related to Qlik NPrinting.

How to Distribute Reports after Successful .qvw Reload on a QlikView Server with Publisher

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

Configure-your-source-documents.png
  • 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

Create-a-QlikView-Server-Reload-Task-.png
  • 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

Distribute-the-Reloaded-Document-to-a-Folder.png

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

Trigger-the-Reload.png
  • 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

Set-NPrinting-Service-to-Accept-External-Requests.png
  • Open the NPrinting Management Console
  • Enable the external requests flag
  • Insert the Source Folder. For instance C:\NPrintingTraining\ExternalRequestsXML
  • Start the NPrinting Service

It's very important that you know the tutorial "How to Execute NPrinting Reports by External XML" Request very well.

Create the External Request File

Create-the-External-Request-File.png

In the folder C:\NPrintingTraining\ExternalRequestsXML create the text file QVS.processed. The code to insert is:

<?xml version="1.0"?>

<schedules>

<schedule file="C:\NPrintingTraining\NPrintingFiles\NPrintingTraining.nsq" type="job" entityName="Send a Report via Email" />

</schedules>


This will run the job "Send a Report via Email" that must be present in the .nsq file. To create a job refer to "How to Create Jobs"

Create the Batch File

Create-the-Batch-File.png

In the folder C:\NPrintingTraining\ExternalRequestsXML create the file QVS.bat with the code:

move C:\NPrintingTraining\ExternalRequestsXML\QVS.processed C:\NPrintingTraining\ExternalRequestsXML\QVS.request

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

Open-the-External-Program-in-QlikView-Server.png
  1. Select the "System" tab
  2. Click on "Supporting Tasks"
  3. 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

Create-a-new-Task.png
  • 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

Trigger-the-Task.png
  • 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.

Labels (1)
Comments
rsvebeck
Valued Contributor

 

Good Guide! Very useful!

 

I have a suggestion to make the solution even better. Instead of running the batch file with a supporting task, I created a QVW running the EXECUTE command with the same script.

 

Then I added a variable in this QVW that will control which NPrinting document to start.

 

The variable value is then controlled by the Publisher-reload job. So in the end I just have one QVW that exists in Publisher that is used for starting all my NPrinting documents.

Regards,

Robert Svebeck

 

 

sohailansari201
Contributor

Hello Robert,

Can you please elaborate your solution a little bit more. I have a similar situation and your solution looks elegant. But I am not able to completely understand your solution here.

Thank you,

Sohail

rsvebeck
Valued Contributor

Hi Sohail, sorry for late reply.

I will try to write a whitepaper and post it to the forum.

brg Robert

deepak_pillai
New Contributor

Hello Robert,

Your QVW idea seems very interesting. Did you get around to putting up a whitepaper for this please?

Thanks

Deepak

do_robert
New Contributor

Hello Everyone

Does anybody of you know how to do this with QlikView 12.10 and NPrinting 17.3.

That would be very helpful for us.

Thanks

Robert

shivani_singhal
New Contributor III

Hi Everyone,

I have some applications and their scheduling complete at 7:36 AM. And scheduling of N Printing triggers at 7:50 AM. And apps were reloaded successfully at their correct time. But the N Printing doesn't trigger at 7:50 AM. What can be the reason of this issue. Also if I manually run the N Printing task, it is working properly. But automated process is not working.

Thanks and Regards,

Shivani Singhal

do_robert
New Contributor

Hello Deepak

Not so far, as I heard it should be possible with the NPrinting Version 17.4 (June)

Greetings

Robert

renuka_sasikumar
Contributor III

Hi Robert,

Did you got any solution for Distribute Reports after Successful QlikView 12.10 and NPrinting 17.3

Regards,

Renuka S

do_robert
New Contributor

Hello Renuka

I am sorry for the late reply. Somehow I did not see your message.

So far, we have installed 17.4 (June) on our Server. With 17.4 it is possible to run and stop tasks over APIs which are provided. I think it is not possible with your Version.

Let me know if you have any details on how we can use the APIs for this specific purpose.

Regards,

Robert

rajni_batra
Valued Contributor

Hi Robert ,

Can you share example for how you did this for all NPrinting jobs in single QVW,

it would help alot.

Version history
Revision #:
1 of 1
Last update:
‎11-04-2015 10:58 AM
Updated by: