How to Use Current Selections with On-Demand Reporting

    You need to download and install the following before starting this tutorial :


    • the NPrinting Training Environment, which contains working examples for this tutorial, by downloading NPrinting Training Material and extracting it into C:\NPrintingTraining\ so that the relative path structure remains valid
    • NPrinting Client, NPrinting Server, and NPrinting Components after downloading them from our download page

     

     

    You'll learn in this tutorial how to send On-Demand reports that have been filtered dynamically by filters that the user has set specifically for this distribution. The suggested architecture has two .qvw's, one as GUI (Graphic User Interface) published on the QlikView server or opened by users locally on a QlikView Desktop, and one with data and charts used by NPrinting reports. You can, of course, use a single .qvw, but it is recommended to separate GUI from data. When we speak about current selections, we mean the filters applied by the final user on the .qvw providing the graphic interface. Add List Boxes to QlikView documents so users will be able to set filters and then request filtered reports. Please note that NPrinting filters, those saved in NPrinting Project files, have higher priority than Additional Filters added through current selections. This means:

     

    • If current selections are set in a QlikView document and a report contains pre-existing NPrinting filters applied to the same fields, the current selections will be replaced by the pre-existing NPrinting filters. Example: a user selects Country=UK in a QlikView document’s list box and an NPrinting Report contains filters for Country=Austria and Salesman=Joan Callins, the NPrinting selections will prevail
    • If current selections are present in a QlikView document and a user adds additional filters to an NPrinting Report Object (Right click on the NPrinting Report Extension button -> Filters settings -> Additional saved filters, then enters the name of filters already saved in the NPrinting project) to the same fields, the additional filters will not be applied. Example: a user selects Country=UK in the QlikView filter box and then adds Country=USA as an additional filter, only Country=UK will be applied.
    • If a user selects some values on fields not present in the NPrinting filters, they will be added to the filters. Example: a user selects Category=Babywear and the NPrinting filters are Country=Argentina and Year=2013, the report will contain data on Babywear sold in Argentina during 2013

     

    Preparatory activities:

    • Start NPrinting up and open the NPrinting file C:\NPrintingTraining\NPrintingFiles\OnDemand.nsq
    • Clone the report PowerPoint Report with Multiple Pages and rename the clone PowerPoint Report with Multiple Pages - Current Selections
    • Clear all selections from SalesDemo for Ajax.qvw, then save and close
      
      
          
            

    Add New NPrinting Report Extension to Sheet

                      
                Add-New-NPrinting-Report-Extension-to-Sheet copy.png                  
            

    Open the QlikView document C:\NPrintingTraining\QlikViewDocuments\SalesDemo for Ajax.qvw and add a new NPrinting Report Extension, see: How to Use NPrinting Extensions in Qlikview Documents.

          
          
          
            

    Configure Button Appearance I

                      
                Configure-Button-Appearance-I.png                  
            
    1. Click on the "fx" symbol at the extreme right of the Text field to open a more spacious editor for entering PowerPoint Report with Multiple Pages - Current Selections
    2. Click on the OK button.
          
          
          
            

    Set Button Color

                      
                Set-Button-Color.png                  
            

    Button color: it’s the color of the button in HTML format. Insert the QlikView formula =rgb(66,80,80) to convert an RGB sequence into an HTML color code.

          
          
          
            

    Configure On-Demand Service Connection

                      
                Configure-On-Demand-Service-Connection.png                  
            

    Check that the parameters are as below, or adjust them for your special circumstances:

    • Hostname: localhost or the name of your server
    • HTTP Port: 9001
          
          
          
            

    Configure Report Settings

                      
                Configure-Report-Settings.png                  
            

    Set as follows:

    • Friendly name: MultiPage PowerPoint Report with Current Selections, this appears in the log entry
    • NPrinting project path: C:\NPrintingTraining\NPrintingFiles\OnDemand.nsq or your path to the NPrinting project file
    • Report ID: PowerPoint Report with Multiple Pages - Current Selections, this must be exactly as in the NPrinting Project file
    • Connection ID: Sales Demo
    • Output format: PDF

     

          
          
          
            

    Configure Filter Settings

                      
                Configure-Filter-Settings.png                  
            
    1. Put a check mark in the Use current selections box
    2. Click on the 'X' to save and close
          
          
          
            

    Add Year List Box

                      
                Add-Year-List-Box.png                  
            

    Drag and drop the List Box icon onto the sheet and edit the resulting list box so that its field is Year.

          
          
          
            

    Add CategoryName List Box

                      
                Add-CategoryName-List-Box.png                  
            

    Drag and drop the List Box icon onto the sheet and edit the resulting list box so that its field is CategoryName.

          
          
          
            

    Add Country List Box

                      
                Add-Country-List-Box.png                  
            

    Drag and drop the List Box icon onto the sheet one more time and edit the resulting list box so that its field is Country.

          
          
          
            

    Save Your Work

                      
                Save-Your-Work.png                  
            

    Click on the 3.5" floppy disk icon to save the entire QlikView document.

          
          
          
            

    Set Selections and Demand Report Generation

                      
                Set-Selections-and-Demand-Report-Generation.png                  
            

    Make some selections in the list boxes. Select Year=2012 and Country=France for instance, then request generation of the PowerPoint Report with Multiple Pages - Current Selections report. Please ignore the Interactive Services Detections message if it appears and wait until the NPrinting Queue button shows that the report is ready.

     

    Trick: open the Windows task manager performance tab: keeping under control the CPU usage you’ll see that your PC is working.

          
          
          
            

    Open Reports Queue and Report

                      
                Open-Reports-Queue-and-Report.png                  
            
    1. Click directly on the Reports queue (1) button
    2. Click on the MultiPage PowerPoint Report with Current Selections entry
          
          
          
            

    Inspect Report

                      
                Inspect-Report copy.png                  
            

    Click on the NPrinting Queue button and open the report: it will have 2 pages as can be seen above, a cover, a report for France in 2012. NPrinting has applied the filters you selected in the QlikView document.

          
          
          
            

    Demand Report Generation

                      
                Demand-Report-Generation.png                  
            

    Keep the same selections in the list boxes: Year=2012 and Country=France and request generation of the  PowerPoint Report with Multiple Pages report.

          
          
          
            

    Open Reports Queue and Report Again

                      
                Open-Reports-Queue-and-Report-Again.png                  
            
    1. Click directly on the Reports queue (1) button
    2. Click on the PowerPoint Report with Multiple Pages entry at the top of the list
          
          
          
            

    Inspect Second Report

                      
                Inspect-Second-Report.png                  
            

    The report has 7 pages as can be seen above, a cover and two reports for Germany, the UK and the USA each, one for both 2012 and 2013. NPrinting applied the filters in the report in the .nsq file and ignored your current selections. If you set a current selection on fields already used in NPrinting filters these have an highest priority and the current selection on the same fields are ignored

          
          
          
            

    Demand Report Generation with Altered Selections

                      
                Demand-Report-Generation-with-Altered-Selections.png                  
            

    Clear the selections in the Year and Country list boxes and select Babywear in the CategoryName list box. Now request generation of the PowerPoint Report with Multiple Pages report.

          
          
          
            

    Open Reports Queue and Report One Last Time

                      
                Open-Reports-Queue-and-Report-One-Last-Time.png                  
            
    1. Click directly on the Reports queue (1) button
    2. Click on the PowerPoint Report with Multiple Pages entry at the top of the list
          
          
          
            

    Inspect This Last Report

                      
                Inspect-This-Last-Report copy.png                  
            

    The report will have 7 pages as can be seen above, the cover and 2 slides each for Germany, the UK and the USA, one for 2012 and one for 2013, having sales figures only for the category Babywear. The current selection was set on a field different from those having NPrinting filters applied to them, so all filters have their effect.

     

    We suggest that you do How to Use Specific Filters with NPrinting On-Demand Reporting now that you have completed this tutorial.