DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Delegated Transport, Forked Authorization: Where Chat and AI-Agent Integrations Actually Break
  • A Non-Expiring AKS Deployment Token Could Read Secrets Across Three Namespaces
  • The Permission Was Valid. The Action Was Not Authorized.
  • Why AI Agents Need a Shared Enterprise Ontology

Trending

  • Closing the Drift Loop: An AI Agent That Drafts Terraform Fixes
  • Batching Strategies: Throughput vs Latency in Practice
  • The Window Closes: Why I Switched to Kotlin Before the Codebase Got Too Big
  • Designing Frontend Applications for Failure, Not Just Success

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Databases
  4. The NPrinting API for Noobs

The NPrinting API for Noobs

It started with a question: Can we trigger an NPrinting task to publish reports right after data reload is successfully performed by Qlik Sense or QlikView?

By 
Wuzhong Zhu
·
Oct. 23, 17 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
11.8K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

NPrinting is important for many users. In the 2017 June release, on-demand reporting is enabled with the NPrinting API. Immediately after the release, the above question was raised to me. I spent a few days trying to prototype a solution but ended up with something that is so simple that anyone can do it in 10 minutes. Frustrating? Yes, because I spent so much time on something that is just a little bit better than “Hello, World!” On the other hand, simple is awesome; simple means even a non-technical user can implement it without problem. Pretty cool.

With that, I’m sharing my experience in case I can help others stuck with a similar problem.

Image title

Long story short, it is implemented with a single HTML file, not even a server is required.

1. Create an HTML file and paste this code into it.

2. Modify the task IDs.

3. Modify the API endpoint URI.

Image title

4. Now open the HTML file via a browser (I used Chrome). You should then be able to see your browser pop-up and close immediately after that.

5. That’s it, you’re done! Now you should see the task running in the NPrinting web console.

Image title

But how can you automate this process, you ask?

1. In Qlik Sense or QlikView, call a batch file to open your HTML file with Chrome:

start chrome “C:\Users\…your directory…..\nprintingApiTest.html”

Image title

Things to Note

1. The Qlik NPrinting API is stated as experimental, which means it may be modified in future. This solution is based on 2017 June released.

Image title

2. How to find the task ID:

Image title

3. HTTPS vs. HTTP:

It took me hours to realize that it is HTTP in the documentation, but my actual server is HTTPS. I hope I am the only stupid one here, but wanted to note it.

4. About the NTLM login:

The user is prohibited from doing anything without a login for NPrinting and NTLM is the only login mechanism supported via the API (for now). So, before you implement anything, you should have a rough understanding of NTLM.

When you open the NPrinting web console/news stand, you will see the following login page. Here you have two options: Windows login or email and password login. The Windows login is the NTLM login.

NTLM takes your Windows credentials to login into another system.

Image title

In the NPrinting user console, there is an entry for the domain account. This is for enabling Windows login. If it doesn’t work, check the direction of the slash as shown below.

Image title

How to get the domain and username in cmd:

Image title

Take note that the domain username pair is tagged to your NPrinting user.

Also, sessions are handled by the browser. If you close your browser, the login state will be lost and you must re-login.

Keeping a session alive is particularly challenging with other technology. There are several NTLM libraries for Python and Node but I didn’t have luck with them. Let me know if you have any questions. And definitely let me know if you get it to work.

Cheers and happy hacking!

API

Published at DZone with permission of Wuzhong Zhu. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Delegated Transport, Forked Authorization: Where Chat and AI-Agent Integrations Actually Break
  • A Non-Expiring AKS Deployment Token Could Read Secrets Across Three Namespaces
  • The Permission Was Valid. The Action Was Not Authorized.
  • Why AI Agents Need a Shared Enterprise Ontology

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook