Qlik Community

Qlik NPrinting Documents

Documents related to Qlik NPrinting.

How to Use Environment Variables

Not applicable

How to Use Environment Variables

Moving an NPrinting project is easier thanks to the new feature that lets you configure environment variables. NPrinting supports environment variables, custom variables and relative paths in template files and .qvw paths. When you move your project you'll only need to change the variable values.

        

Open the Environment Variables

                  
            Open-the-Environment-Variables.png                  
  1. Select Tools tab in the upper-right side of the window
  2. Click on Environment Variables
        

Create a New Environment Variable

                  
            Create-a-New-Environment-Variable.png                  
        

The Environment Variables window lets you manage the environment variables that can be used in paths. A grid shows all configurable environment variables. The "Environment Configuration" can be also opened using the  new "Configure" button in the "NPrinting Files" section of the Management Console.

  1. Click on the New button
  2. Enter evProjectRoot as Name. We suggest beginning the name with "ev"
  3. Enter the path to the NPrinting project folder or browse - select the folder by clicking on the browse button at the far right.
  4. Click OK

If this variable already exists, click on the Edit button and change its Value with the new project folder.

Create the Template Files Variable

                  
            Create-the-Template-Files-Variable.png                  
        

You can use an Environment Variable to create another variable. The second variable will be affected by changes made to the first one.

  1. Click on New
  2. Enter evTemplates as Name
  3. Click on the Environment Variables button
        

Select the Environment Variable Already Created

                  
            Select-the-Environment-Variable-Already-Created.png                  
        

In this window you can see three kinds of variables:

  • NPrinting Variables: there are variables for some of the folders you specify in the NPrinting Options. For example: “Default output folder”, “Default templates folder”, etc. These variables have the NPrinting logo as icon.
  • User Variables: inserted by the developer using the “Environment Variables” icon in the “Tools” bar and represented by a “man-shaped” icon
  • System Variables: are the path variables defined in your OS and represented by a PC icon. To see them in a Report template or a QlikView document path, click on the variable icon (the blue one near the “dots” on the right) then right-click on one row and select “Show system variables”
  1. Select the evProjectRoot variable just created
  2. Click on OK
        

Complete the Template Path

                  
            Complete-the-Template-Path.png                  
        
  1. Add the name of the Templates folder
  2. Click on OK

Repeat these steps for each folder that you want to add. Do this if you want to transfer projects between computers. Simply change the evProjectRoot variable value.

The Use of Environment Variables in Reports

                  
            The-Use-of-Environment-Variables-in-Reports.png                  
        

You can use Environment Variables by clicking on the button to the right of the Template name field to set the path. It’s also possible to insert an environment variable in the Tasks output folder. If you hover your mouse pointer over the inserted environment variable tag you will see the complete path.

The Use of Environment Variables in Tasks

                  
            The-Use-of-Environment-Variables-in-Tasks.png                  
        

In the task setting window, select Custom folder as the Output folder field

        

Add the Environment Variable

                  
            Add-the-Environment-Variable.png                  
        
  1. Select Environment Variable as Type from the drop-down menu
  2. Click on the three dots
  3. Select desired variable
  4. Click OK
        

Path updates with Environment Variables

                  
            Path-updates-with-Environment-Variables.png                  
        

Optimize Paths easily converts absolute paths from old NPrinting projects into paths that include Environment Variables in an NPrinting project.

  1. Select Tools tab on the upper-right side of the window
  2. Click on Optimize Paths

Update Paths

                  
            Update-Paths.png                 
        

The Current Path column represents the old path whereas the Optimized Path includes the proposed path with variables.

  1. Select the paths you want to update by checking their respective boxes in the Update column
  2. Click the Update button
      
Labels (1)
Comments
stevelord
Valued Contributor

Hi, Could this variable filepath work in the Qlikview Document field of the nprinting Source too per chance?

For instance, the nsq opens to whichever source connection the variable is currently set to, then the variable is changed, then the reload job is run off the qlikview in the updated source file path?  (The reports are just csv or excel reports grabbing TB01 off whichever qlikview.)

Also, could you recommend a piece of powershell script that can be used to navigate to and edit the Value field of one of the variables in the environmental variables?  I think maybe just changing abc to xyz in the nprinting interface for your example would suffice.  (My colleagues are checking on that, but thought I'd ask here for a little extra input.  It's an important piece of a bigger project underway. )

Version history
Revision #:
1 of 1
Last update:
‎11-10-2015 02:08 PM
Updated by: