Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Senor_Dai
Partner - Creator II
Partner - Creator II

Create NPrinting OnDemand Request using Javascript and APIs

Hello,

I am able to trigger an NPrint Publish task from a button in my Qlikview app using the following Javascript action:

{   
var xhr = new XMLHttpRequest();

xhr.open('POST', 'https://mynprintserver.com/api/v1/tasks/ce8uff26-978b-4ff8-8388-1d7887653443/executions', true); 
xhr.withCredentials = true; 
xhr.send(null);

console.log("Finished")
       
}   

I'm having difficulty trying to understand the Qlik API reference document :
https://help.qlik.com/en-US/nprinting/November2020/APIs/NP+API/index.html?page=34

to try and create a Javascript as per the Publish Task at the start of my post.  

I'd be very very grateful if anyone can advise on how to build a function trigger an ondemand report?

Many many thanks.

 

Dai

 

Labels (2)
3 Replies
Ruggero_Piccoli
Support
Support

Hi,

You need to login with NTML authentication and retriave the connection token. Then you use that token, that is different for every session, to run the post api.

I wrote a tutorial yesterday https://community.qlik.com/t5/Qlik-NPrinting-Documents/How-to-manage-Qlik-NPrinting-users-by-using-A... and there are othe r conversations here in the community.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
p_verkooijen
Partner - Specialist
Partner - Specialist

Hi @Senor_Dai,Have you ever managed to realize the solution? 
We having issues implementing the new OnDemand QlikView plugin, it lacks several options and features than the "old" v16 version had. 

Qlik sadly said al below as working "by design"

  • Conditional onDemand reports, users have to make specific selections before the report can be succesfull (any report can be started any time on any sheet)
  • Default output keeps reverting to the first sorted value in dropdown, a Excel is always default HTML 
  • Trigger a task to mail a report to myself, instead of waiting for task to finally end
  • Reportnames are not dynamic, if you trigger 4 reports you cannot see what is what. 
nishika
Partner - Contributor III
Partner - Contributor III

{   
var xhr = new XMLHttpRequest();

xhr.open('POST', 'https://mynprintserver.com/api/v1/tasks/ce8uff26-978b-4ff8-8388-1d7887653443/executions', true); 
xhr.withCredentials = true; 
xhr.send(null);

console.log("Finished")
       
}  

 

where to put this script in qlik Front end