Qlik Community

Qlik NPrinting Documents

Documents related to Qlik NPrinting.

How to Use NPrinting On-Demand with Section Access

Employee
Employee

How to Use NPrinting On-Demand with Section Access

We suggest that you do the How to Make Reports Selectable with NPrinting On-Demand tutorial before doing this tutorial.

This tutorial explains how to use Section Access combined with NPrinting On-Demand in order to get or send reports on demand that are filtered according to the Section Access connected user.

NPrinting does not support NT Security to authenticate Section Access users. You cannot specify NTNAME, NTDOMAINSID or NTSID in the loading script. If your QlikView document uses NT Security, you need to create a QlikView user with administrative rights that can access all data. You then need to create a recipient for each user and apply related filters. Please note that you can import recipients with filter definitions from external files, databases or QlikView charts. In the following example we use the Load * INLINE method to obtain a clear explanation, however, you can load the section access users with the method you prefer.

The first part of the tutorial explains how to preview a report filtered for a Section Access user. The second part will explain how to send a report to the connected Section Access user.

Attention: remember to save QlikView documents used as NPrinting connections with WebView mode deactivated. NPrinting cannot open QlikView documents with WebView mode activated because it doesn't have full control of QlikView functionalities.

   
   
       
         

Part I: Preview a Report Filtered for a Section Access User

       
       
       
         

Make & Rename Copy

                   
            Make--amp--Rename-Copy.png                   
         

Make a copy of SalesDemo for Ajax.qvw in C:\NPrintingTraining\QlikViewDocuments\ and call it SalesDemo for Ajax - Section Access.qvw

       
       
       
         

Change Script for QlikView

                   
            Change-Script-for-QlikView.png                   
         
  1. Open C:\NPrintingTraining\QlikViewDocuments\SalesDemo for Ajax - Section Access.qvw in QlikView
  2. Open the script editor (press ctrl+e)
  3. Add the following piece of script after the Binary .\salesdemo.qvw; instruction at the beginning of the script
  • Section Access;
  • LOAD * INLINE [
  • ACCESS, USERID, PASSWORD, MAN
  • ADMIN, ADMIN, ADMIN, *
  • USER, Elvis, Elvis, 2
  • USER, Helen, Helen, 9
  • USER, USER1, U1, *
  • USER, USER2, U2, *
  • USER, USER3, U3, *
  • ];
  • SECTION APPLICATION;
  • SALES:
  • LOAD * INLINE [
  • MAN, EmployeeID
  • 2, 2
  • 9, 9
  • ];

4.    Save the script and reload (ctrl+r).

This will create the new Section Access users and connect Elvis and Helen to respective salesman in the .qvw so when Elvis will connect into the QlikView doc he will see only his data

5.    Exit QlikView

       
       
       
         

SalesDemo for Ajax.qvw - Section Access in C:\NPrintingTraining\QlikViewDocuments\ contains the NPrinting Report Extension button called PowerPoint Report with Multiple Pages - Current Selections and the others. Do the tutorial, How to Use NPrinting Extensions in Qlikview Documents, to learn more on how to create it. Let's embed a new text box to display the user who is currently logged in.

  • Open SalesDemo for Ajax - Section Access.qvw and connect using User ID: Admin and Password: Admin
       
       
       
         

Turn on WebView

                   
            Turn-on-WebView.png                   
         
  1. Click on View in the menu bar
  2. Make sure WebView is turned on: the icon at the left has an orange background
       
       
       
         

Embed Text Object in Sheet

                   
            Embed-Text-Object-in-Sheet.png                   
         

Right click on an empty part of the sheet, select New sheet object from the menu that appears, then drag and drop a new Text Object onto the sheet.

       
       
       
         

Configure Button Label

                   
            Configure-Button-Label.png                   
         
  1. Right click on the new object
  2. Select Properties
  3. Enter the QlikView formula, ='Section Access User: ' & QVUser(), into the Text: box. This will display the user who is currently logged in with section access.

Now Save the QlikView document and exit QlikView. Reopen SalesDemo for Ajax - Section Access.qvw in C:\NPrintingTraining\QlikViewDocuments\

       
       
       
         

Log in as Elvis

                   
            Log-in-as-Elvis.png                   
         

Enter Elvis in both the User ID and the Password fields clicking on the OK button each time.

       
       
       
         

Set QlikView Selections

                   
            Set-QlikView-Selections.png                   
         
  1. Select 2013 in Year list box
  2. Demand to generation of the PowerPoint Report with Multiple Pages - Current Selections report
       
       
       
         

Inspect Report

                   
            Inspect-Report.png                   
         

When the report is ready, open it. The first slide displays the selections applied at the moment of creation. Year: 2013 from your current selection and Salesman: Elvis Presley from Section Access, as expected. Both filters were applied.

       
       
       
         

Part II:  Send Filtered Report to User logged in with Section Access

       
       
       
         

Create or Clone New Recipient

                   
            Create-or-Clone-New-Recipient.png                   
         

Create an NPrinting recipient named ELVIS (all caps). It is easiest just to clone recipient Elvis Presley and change the Name to obtain the new Section Access user.

See this tutorial about recipients: How to Create and Import Recipients with Filters and Distribution Groups

Remember to customize the email address if you are using the NPrinting training environment.

       
       
       
         

Create New Task

                   
            Create-New-Task.png                   
         

Create Task Send Top 25 Products with Current Selection in the NPrinting project

(see: link tutorial task on demand)

       
       
       
         

Add Report to Task

                   
            Add-Report-to-Task.png                   
         

Add Excel Report Top 25 Products to the task. This is a very simple Excel report, easy to create. See: How to Create Excel Reports

       
       
       
         

Add Recipient to Task

                   
            Add-Recipient-to-Task.png                   
         

It is mandatory to insert a recipient, No email, here with an email address, otherwise NPrinting won’t let you activate email report. You can insert an email address that nobody will read or an address like a@b.c.

       
       
       
         

Create E-mail Message

                   
            Create-E-mail-Message.png                   
         
       
       
       
         

Embed Run Task Button in Sheet

                   
            Embed-Run-Task-Button-in-Sheet.png                   
         

Add an NPrinting task extension that runs Task Send Top 25 Products with Current Selections.

  • Reopen SalesDemo for Ajax - Section Access.qvw using User ID: Admin and Password: Admin
  • Right click on the sheet, select New sheet object, click on Extension object, and then drag and drop NPrinting Task object onto the sheet.
       
       
       
         

Configure Button Appearance

                   
            Configure-Button-Appearance.png                   
         

Right click on the new button and select Properties. Select Button appearance and configure the following fields as indicated:

  • Text: Task Send Top 25 Products with Current Selections
  • Button color: =rgb(66,80,80)
       
       
       
         

Configure On-Demand Service Connection

                   
            Configure-On-Demand-Service-Connection.png                   
         

Click on On-Demand service connection and configure the following fields as indicated:

  • Hostname: localhost
  • HTTP Port: 9001
       
       
       
         

Configure Task Settings

                   
            Configure-Task-Settings.png                   
         

Click on Task settings and configure the following fields as indicated:

  • Friendly name: Task Send Top 25 Products with Current Selections
  • NPrinting Project path: C:\NPrintingTraining\NPrintingFiles\OnDemand.nsq
  • Report ID: Task Send Top 25 Products with Current Selection
  • Connection ID: Sales Demo
  • Additional recipients: enter the QlikView formula =QVUser(). This formula returns the active recipient and sends them to NPrinting service so it will send them the reports. Dynamic selection is obtained using this QlikView formula.
       
       
       
         

Configure Filter Settings

                   
            Configure-Filter-Settings.png                   
         

Click on Filter settings and configure as indicated:

  • Use current selections: check marked

Close the object Properties editor, then save the QVW and close it.

       
       
       
         

Clear All Selections

                   
            Clear-All-Selections.png                   
         
  • Reopen SalesDemo for Ajax - Section Access.qvw in C:\NPrintingTraining\QlikViewDocuments\ and log in as the user Elvis.
  • Clear all selections if any are set.
       
       
       
         

Demand Report Generation and Distribution

                   
            Demand-Report-Generation-and-Distribution.png                   
         

Click on the run task button entitled: Task Send Top 25 Products with Current Selections.

       
       
       
         

Check E-mail

                   
            Check-E-mail.png                   
         

Go to the e-mail account you put in the ELVIS recipient and look for a message for ELVIS.

       
       
       
         

Inspect New Report

                   
            Inspect-New-Report.png                   
         

Download and open the report for ELVIS. Note the heading.

       
       
       
         

Add Selection

                   
            Add-Selection.png                   
         

Now add a a selection, Year=2013 for instance and run the task again. You’ll find a report in the associated e-mail account box containing data filtered by Salesman=Elvis Presley (as before) and by Year=2013.

       
       
       
         

Inspect This Third Report

                   
            Inspect-This-Third-Report.png                   
         

Close the report and the QlikView document in QlikView.

       
       
       
         

Reopen SalesDemo for Ajax - Section Access.qvw as Helen

                   
            Reopen-SalesDemo-for-Ajax---Section-Accessqvw-as-H.png                   
         

Open the document with User ID: Helen and Password: Helen

       
       
       
         

Demand Report Generation and Distribution Again

                   
            Demand-Report-Generation-and-Distribution-Again.png                   
         

Click on the run task button entitled: Task Send Top 25 Products with Current Selections.

       
       
       
         

No E-mail Sent!

                   
            No-E-mail-Sent-.png                   
         

There is no NPrinting recipient associated with Helen.

       
       
   
 
Labels (1)
Version history
Revision #:
1 of 1
Last update:
‎11-10-2015 04:33 AM
Updated by: