Overview
Most of the modern day reporting needs like data discovery features, interactive dashboards with slicing and
dicing and ad-hoc reporting are addressed by leading tools like Qlik, Tableau, Power BI etc. While these
modern features are super critical to businesses, the enterprises still continue to have a need to create
printable, paginated reports that can be distributed via email attachments etc., for various reasons.
Enterprises are struggling to find a single tool with the capability to create interactive reports as well
as paginated reports.
To bridge the gap, Qlik has introduced NPrinting as a Qlik component to create printable reports.
NPrinting (NP) reports data in the desired format like excel, word, pixel perfect, etc. A lot can be done in
NPrinting, from a static report with single/multiuser users to reports delivered to dynamic users every X
period.
NPrinting reports with Qlik is gaining much traction, with many users wanting to have reports delivered to
their respective emails or a chosen destination.
In most cases, everything from reloading the connection metadata, clearing a user group, importing a
user/user group, and triggering a task is handled within the Qlik NPrinting web console by scheduling the
same wherever possible or by manual intervention. This may not always be an ideal way to do so because the
data for the NPrinting reports come from either QlikView or Qlik Sense apps, and there is no way a
dependency would be set when handling everything via Qlik NPrinting web console. Let us try to understand
this with an example - a Qlik app is scheduled to trigger at 3 a.m. IST daily, and the corresponding
NPrinting task is scheduled to trigger at 5 p.m. IST. Currently, both Qlik and NPriniting are time-based,
and for some reason, the Qlik app failed to execute, but the NPriniting task triggered precisely as per
schedule. Now NPrinting report is looking at the Qlik app and is rendering stale data as the Qlik app did
not execute on the same day as expected.
Using Qlikview NPrinting APIs
In the following explanation, we will see how NPrinting APIs could be leveraged to avoid a case like the
above and ensure the reports show updated data. The requirement is to send NPrinting reports to a set of N
users weekly once; in this case, the user's list is a dynamic count that changes weekly. In this document,
we will see NPrinting API for - reloading connection metadata, fetching user information, clearing an NP
group, and triggering Import and Publish tasks.
Code Snippets
- Sub-routine to clear NPrinting group - clear the NPrinting groups every week so updated user list can be
imported before every run.
- Publish task call – Upon successful completion of the clear group, generate the recipients and
import
the same.
The above calls the NPrinting publish task to generate the recipient's file. In the below code, proceed
to import the file only after the successful completion of the recipient generation.
- Upon successful completion of recipient generation and importing the same, finally trigger the NPrinting
task that publishes the final report to end users.
Note that in the code snippets, before proceeding to the next step, there is always a check on the task
status to ensure we move forward only if the previously executed step is completed fine. This way, we set a
dependency check at every stage to ensure nothing goes wrong.
Conclusion
Leveraging Qlik NPrinting APIs can unlock a world of possibilities for report generation and distribution,
offering flexibility and customization beyond out-of-the-box features. With the ability to automate report
generation and distribution across multiple platforms and recipients, Qlik NPrinting APIs provide an
efficient and scalable solution for organizations. By utilizing Qlik NPrinting APIs, businesses can
streamline their reporting process and focus on driving valuable insights and outcomes from their data. Many
other Qlik NPrinting APIs can be implemented to achieve the desired and the same can be referenced
from here.
Whether you are a Qlik user or just curious about reporting services, Nous can offer you useful insights to
help achieving business goals. Learn how to take your Qlik Reporting Services to the
next level.