How to Manage PixelPerfect Conditional Output Formats Using the Formatting Rules Editor

    This article explains how to create PixelPerfect reports with a conditional table display view. The final output will show a page that contains a Chart and a Table that will completely be hidden when it doesn't contain data.

    Create New PixelPerfect Report

                      
                Create-New-PixelPerfect-Report.png                  
            

    Run NPrinting Client and open the project C:\NPrintingTraining\NPrintingFiles\NPrintingTraining.nsq

    1. Click on Reports
    2. Select PixelPerfect reports
    3. Click on the PixelPerfect Report button to create a new one
    4. Enter PixelPerfect Report Conditional Table Display as the report Name

    Create a New PixelPerfect Report Template

                      
                Create-a-New-PixelPerfect-Report-Template.png                  
            
    1. Click on New to open a blank template in the Template Editor
    2. Right-click on the Levels node to add a level
    3. Select the Add levels option

    Insert a QlikView Table as a Level

                      
              Insert-a-QlikView-Table-as-a-Level.png                   
            
    1. Be sure that the Connection "SalesDemo" is selected, otherwise open the "Connection" drop-down menu and select it
    2. Enter '337' into the search field and the number of candidate objects will be reduced
    3. If Sales in Europe (CH337) is the only visible object, press Enter to add it into the Levels node; otherwise select it in the list
    4. Click on the OK button

    Change the "Visible" Property in the Details Band

                      
                Change-the--Visible--Property-in-the-Details-Band-.png                  
            

    Create a new table, as you would normally do in a PixelPerfect report, based on CH337. Refer to the tutorial "How to Create a Simple PixelPerfect Report".

    Then:

    1. Select DetailReport - "CH337_Level"
    2. Change the "Visible" property from "Yes" to "No".

    Open the Formatting Rule Editor

                      
                Open-the-Formatting-Rule-Editor.png                  
            
    1. Select the Detail Band
    2. Click on the smart tag (">") button at the top of the band
    3. Click on the browse button at the right end of the Formatting Rules field to open the Formatting Rules Editor.

    Create a New Rule

                      
                Create-a-New-Rule.png                  
            

    This form shows all the available rules in a report.

    1. Click on Edit Rule Sheet.

    Create a New Formatting Rule

                      
                Create-a-New-Formatting-Rule.png                  
            
    1. Click on the "+" button to add a new rule
    2. Select CH337_Level as a Data Member value
    3. Insert Sum([Sales]) > 0 in the Condition property. This condition will be true when the selected QlikView Object contains data. By customizing this condition you can met your needs.
    4. Set the "Visible" property to "Yes" from the drop-down menu. This means that when the condition is true the objects with the condition applied will be made visible
    5. Insert ShowWhenHasData as Name
    6. Click Close.

    Apply the Formatting Rule to the Table

                      
                Apply-the-Formatting-Rule-to-the-Table.png                  
            
    1. Select ShowWhenHasData Rule from the list
    2. Click on the button ">" to apply the rule
    3. Confirm with OK.

    Create a New Filter

                      
                Create-a-New-Filter.png                  
            
    1. Click on Filters
    2. Filters will be automatically select
    3. Click on the Filter button to create a new one
    4. Insert Rock Roll Sales as Name
    5. Click Add button.

    For more details on how to create a field based filter refer to the tutorial How to Create Static and Dynamic Filters Based on Fields

    Select Field

                      
                Select-Field.png                  
            
    1. Select the Connection "SalesDemo"
    2. Search and select the Salesman field
    3. Click on the OK button to add the field.

    Select "Rock Roll"

                      
                Select--Rock-Roll-.png                  
            
    1. Click on the Add Values button in the Field window, which opens the Select Values window listing all the values for that field present in the QlikView document
    2. Select Rock Roll
    3. Click on the OK button at the bottom of the Select Values window
    4. Save and Close.

    Create a Filter for "Tom Lindwall"

                      
                Create-a-Filter-for--Tom-Lindwall-.png                  
            
    1. Create another Filter for "Tom Lindwall"
    2. Add it to the report.

    Deactivate a Filter

                      
                Deactivate-a-Filter.png                  
            
    1. Double-click on the first Filter (Rock Roll Sales)
    2. Click on Active button to deactivate the Filter
    3. Exit by clicking on Save and Close.
      

    Generate Preview

                      
                Generate-Preview.png                  
            
    1. Select Preview button to generate the preview. Keep it open.
    2. Click on Filters button and re-activate "Rock Roll" Filter and disable "Tom Lindwall"
    3. Save and Close
    4. Re-click on Preview button.

        

    Compare Previews

                      
                Compare-Previews.png                  
            

    You can see the table only on the second Preview.