Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
vimalthehero
Contributor III
Contributor III

how to call Npriting ondemand requests via qliksense load script

i see several blogs to call nprinting tasks using qliksnese load script via rest apis.

can we call OnDemand nprinting requests via qliksense load scripts too.. for applying some dynamic filters in nprinting..??

 

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @vimalthehero 

When you say: "sometims while providing the btton to users, we seee , users complains they camt generate reports, as they might need to login npringing before pressing ondemand button..." That indicates to me potential issues:

  1. User may not be created in NPriting with required role - as you know eweryone who triggers NPrinting OnDemand report needs to have NPrinting user assigned with the Domain account same as the one they use when accessing Qlik Sense
  2. SSL certificate is not using FQDN (fully quilified domain name) and is not properly configured. I always suggest use of 3rd party trusted certificates
  3. GPC is not configured to ALWAYS prompt users for username and password
  4. NPrinting FQDN and Qlik Sense are not added as trusted sites/Internal sites in GPC

 

For properly working OnDemand Button with Qlik Sense and NPrinting you must ensure all requirements and setings are met: https://help.qlik.com/en-US/nprinting/February2025/Content/NPrinting/On-Demand/Create-Report-On-Dema...

There are also youtube Qlik support videos explaining this issue well:https://www.youtube.com/watch?v=eHVBVoLy16Y

Troubleshooting those issues does not take much time and if company policies are well maintained there should be no issue with this feature.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

16 Replies
mpc
Partner Ambassador
Partner Ambassador

Hi, 

You can use the Qlik REST Connector, and use this endpoint: Qlik NPrinting API − post /ondemand/requests | Qlik NPrinting Help

Best

From Next Decision and mpc with love
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

hi @vimalthehero 

Personally I dont think those end points will work given that they work very differently. The API endpoints we normally use within load script are for actions which are triggered and dont require interactive interface.

I dont think content types from https://help.qlik.com/en-US/nprinting/February2024/APIs/NP+API/index.html?page=45 will be supported in load script.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
vimalthehero
Contributor III
Contributor III
Author

do you have any sample code to refer calling those ondemand apis in Qlik sense load scripts??

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @vimalthehero - that is question to @mpc as he said you could use it in load script.

I personally see no reason using this OnDemand Api in load script. Everything you need can be achieved using other APIs (Filter & task Api) which we know works in Load script and to apply dynamic filters (whatever you mean by that). 

It just look like you are overcomplicating things which can be simpler just by using different solution you have not thought of yet maybe?

Maybe you could share scenario so we could try replicate and suggest you maybe different solution which would give you the same end result. 
cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
vimalthehero
Contributor III
Contributor III
Author

Users will request reports via a Teams chatbox. These requests will trigger an automated process in Qlik Sense to generate the reports based on their specified filters. The generated reports will then be stored in SharePoint for users to access at any time, and they will receive an email notification upon completion.

Note: user wont have access to Qlik Nprinting ondemand report genration directly..!

all users requests will be procces via qliksense load script.. 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @vimalthehero 

Have you considered that for some things you mentioned there are no existing solutions and you will have to build your own piece of soft to support it?

I see lots of issues with your initial proposal:

  • how were you planning to put reports on sharepoint - there is no API on NPrinting side doing this?
  • how were you planning to download reports created via OnDemand so they could be put on sharepoint? You may be able to get reports stored by regular tasks in folders but not via OnDemand tasks!
  • how were you thinking about putting filters in Qlik Sense script given that there may be multiple people trying to run the same thing at the same time you will have performance bottleneck!
  • Why are you planning to use Qlik Sense script for solution which can only do 1/4 of the job in load script? It can potentially trigger reports and pass parameters but at the same time you have think about performance issues this will create and potential concurrency which will not necesarilly work?

Your process looks cool but I cannot see it as a reliable solution as all steps have equivalent in real world but they were designed to work differently.

I may play with API to see if I could trigger simple OnDemand task - but I will do that in my free time as I would have to decipher how requests have to be built and understand how whole process works from API side.

I dont have much more constructive comment at the moment - sorry.

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
vimalthehero
Contributor III
Contributor III
Author

I appreciate your feedback. The following are some of the approaches I plan to implement in response.

 

  • how were you planning to put reports on sharepoint - there is no API on NPrinting side doing this?
    • Nprinting report which we will be geernating will be less than 10 MB and these report will be send to admin email id once it generated.. once the email are send to email id, we will execute power automate task which will store it in sharepoint. ( powerautomate will take care all reports storing tasks to sharepoint. 
  • how were you planning to download reports created via OnDemand so they could be put on sharepoint? You may be able to get reports stored by regular tasks in folders but not via OnDemand tasks!
    • we run all the npringting request as a pre defined Qlik task interval. one by one,, que system.. user will be notigfied only when thoser files are stored in sharepoint folders via powerautomate..! Note: ondeamnd tasks can be set emails once report is genrated too.
  • how were you thinking about putting filters in Qlik Sense script given that there may be multiple people trying to run the same thing at the same time you will have performance bottleneck!
    • Qlik script is written in suah a way that all users filter and request will runn one by one ( que mechanism) and all users filters and request will be intially stored in a excel files which they request via team( chatbox). we procces thse requests one byone.. and keep unique request id to handle multiple user request and this reuest id will be used thorugh the report gnenrations till storing it to sharepoint..! Note: we are not smal team , where team isze is about 25 and user request is few in a day.. this service will be for those who doesnt have time to investigate in Qliksnese repot, but a final report (XLSX) on their request would be enough.. and they can wait till 3 hrosu to get it..!
  • Why are you planning to use Qlik Sense script for solution which can only do 1/4 of the job in load script? It can potentially trigger reports and pass parameters but at the same time you have think about performance issues this will create and potential concurrency which will not necesarilly work?
    • we hae severla user who doesnt know how to effiecently use the Qliksense report as its very compleicated data, but they are ok to get a final report as per the basic filter applied..! since the user bse is less and request will be less .. we thought this approach to help users..! we will keep in mind about the perofrmance issue whie in theimplementation.. currently, i see Qliksense cloud is far better than any data analtics tool.. when it comes to generate report or loading the reports ... 

Currently im trying to figure out the nprinting api call in Qliksense load script, which will be a parent report to run all the nprinting user requests..and figuring out the task exectuign api call

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @vimalthehero 

This is why I have issue with this approach. Many assumptions you were taking are not simple or possible. 

  1. OnDemand generated report are not sent via email hence you will not be able to use it! That obviously changes whole concept as in such case OnDemand API will not work in your framework as it is not designed to achieve your first step!
  2. With that in mind your idea of using OnDemand API has to be dropped as obviously you will not be able to go through the first step.
  3. Given that you cannot use OnDemand you need to take different approach by use of standard tasks - as only those can send emails or store reports to certain locations
    1. Challenges are
      1. you will not be able to easily pass dynamic filters!
        1. Alternatives are:
          1. With each request update a filter and run task job
          2. or gather all filters and create dummy users import and run tasks to those dummy users
  4. I have written comprehensive library of subroutines which can be used for this task: https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/ all details how to use it are in the links inside that post. This is super simple and can be setup in just few minutes. My subroutines cover majority of the API calls such as Authentication, Users and Task as well as Task executions. 
  5. I recognize that my Subroutines dont have Filter Update API as I saw it irrelevant at the time given that much simpler and a lot more reliable solution is to use recipient import file with filters update to do the same: https://help.qlik.com/en-US/nprinting/February2025/Content/NPrinting/DeployingQVNprinting/Import-Use...

Given the responses I am getting in this chat I am not sure you are aware how much consideration you need to take to each of the questions I previously asked as your answers were not taking into account limitations of the existing API and some of the things you are saying you are going to do are just impossible. 

I am also providing comments under your comments in next response to your comment.

cheers

 

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

  • how were you planning to put reports on sharepoint - there is no API on NPrinting side doing this?
    • Nprinting report which we will be geernating will be less than 10 MB and these report will be send to admin email id once it generated.. once the email are send to email id, we will execute power automate task which will store it in sharepoint. ( powerautomate will take care all reports storing tasks to sharepoint. 
      • Sending email is only available via regular Publish Task. To achieve dynamic filtering you will need to update either NPritning user filters assigned to task or report/task filter before each time you trigger report. That can be very unreliable as fitlers must be created properly considering integrity of data model and data types such as (text, asci, date, intiger, timestamp, dual (!!!), and using appriopriet filtering method: https://help.qlik.com/en-US/nprinting/February2025/Content/NPrinting/ReportsDevelopment/Static-dynam...
      •  
  • how were you planning to download reports created via OnDemand so they could be put on sharepoint? You may be able to get reports stored by regular tasks in folders but not via OnDemand tasks!
    • we run all the npringting request as a pre defined Qlik task interval. one by one,, que system.. user will be notigfied only when thoser files are stored in sharepoint folders via powerautomate..! Note: ondeamnd tasks can be set emails once report is genrated too.
      • NPrinting OnDemand requests cannot sent emails!!! Show me documentation which says otheriwise. Only regular publish tasks can send emails but those rely on NPrinting created filters!!!
  • how were you thinking about putting filters in Qlik Sense script given that there may be multiple people trying to run the same thing at the same time you will have performance bottleneck!
    • Qlik script is written in suah a way that all users filter and request will runn one by one ( que mechanism) and all users filters and request will be intially stored in a excel files which they request via team( chatbox). we procces thse requests one byone.. and keep unique request id to handle multiple user request and this reuest id will be used thorugh the report gnenrations till storing it to sharepoint..! Note: we are not smal team , where team isze is about 25 and user request is few in a day.. this service will be for those who doesnt have time to investigate in Qliksnese repot, but a final report (XLSX) on their request would be enough.. and they can wait till 3 hrosu to get it..!
  • Why are you planning to use Qlik Sense script for solution which can only do 1/4 of the job in load script? It can potentially trigger reports and pass parameters but at the same time you have think about performance issues this will create and potential concurrency which will not necesarilly work?
    • we hae severla user who doesnt know how to effiecently use the Qliksense report as its very compleicated data, but they are ok to get a final report as per the basic filter applied..! since the user bse is less and request will be less .. we thought this approach to help users..! we will keep in mind about the perofrmance issue whie in theimplementation.. currently, i see Qliksense cloud is far better than any data analtics tool.. when it comes to generate report or loading the reports ... 
      • I very much disagree - for those users you could actually create sheet with filters they need to apply to generate proper OnDemand NPrinting report. It could be as simple as 1 sheet with filters they shoudl use and OnDemand button apearing conditionally once required filters are applied. If it is not complicated for them to request such report via teams why woudl it be more complicated via dedicated interface?

cheers 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.