Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Loreline
Contributor II
Contributor II

How to show/hide image in PixelPerfect based on value of field selected in QlikSense app?

Hello,

I have created a PixelPerfect report in which I have added 3 images from a local folder. I would like the images to be shown or hidden based on the value of the field LANGUAGE in the QlikSense application.

I have tried the process described by @Daniel_Jenkins in the post "How to define a PixelPerfect DetailReport Visibility via Script (NPrinting)?" without success.

In the QS app I have created the variable vSQSlogo_french =if(LANGUAGE='French', 0, 1). I added it to the NPrinting report's variables objects. I dropped it in the Detail1 section of the report template.

I created a Formatting Rule with the condition "Iif([vSQSlogo_french] = 0, True , False)" and the Visible = True. I set the Data Member as the location level I need in the template.

I added a picture box to the template and selected from a folder the desired image I want to display when the language is French in the QS app.

I applied the rule to the Detail1 and/or to the picture box, with Visible set as No.

No matter what variations I try, they don't work.

Do you have an idea what could go wrong?

Thank you in advance for your help.

 

20 Replies
Loreline
Contributor II
Contributor II
Author

Dear all,

I finally found the solution to my problem using the method described in “How to add dynamic images in a Qlik NPrinting PixelPerfect template with Qlik Sense data”

Here are the steps I followed, if it can help someone else:

1. A container NPrinting can read from was created on our test server and productive server. I saved the images in.

2. In the QS application's script I added a part that combine the different fields and return the relevant path to the image in a new field (ex 1: if(wildmatch(ComputerName(), '*Xx*') = 1,
if(LanguageField = 'English' and CountryField = 'Abc', '\\Container\ReleventImage.JPG' as DiskImage_logo) (ex 2: if(wildmatch(ComputerName(),'*Xx*') = 1, '\\Container\' & LocationField &'_'& PurgeChar(ProductField, '\/:?"<>|') & '.jpg' as DiskImage) 

3. In the front end I created a table with the field new created fields which contains the images' path.

4. In NP designer I followed “How to add dynamic images in a Qlik NPrinting PixelPerfect template with Qlik Sense data” using the object table ID as level in NP pixel report, add a Picture Box, in the properties, Data, expand (Data Bindings), expand Image URL, Binding drop down menu, expand the object in the level and select the DiskImage column. 

5. In the QS app I created a container with two On-demand reporting objects in a container (show condition based on ComputerName) set up for the PDF report. The end users will use it to generate their report.

 

Thank you all for your time helping me!