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.

 

19 Replies
David_Friend
Support
Support

@Loreline looks there we are couple of 'gotcha's found in the comments did you follow those as well? Are you on May 2022?

JonnyPoole
Employee
Employee

https://community.qlik.com/t5/Member-Articles/The-Multi-Report-NPrinting-template-that-conditionally...

You can make it where a filter (selection) changes a level to render 1 or 0 values effectively causing a show/hide for content between the levels tag. See above post.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Same principles as @JonnyPoole presented for excel but this is for pixel perfect - https://community.qlik.com/t5/Member-Articles/How-to-Manage-PixelPerfect-Conditional-Output-Formats-...

 

EDIT: just focus on template side of things as rest is part of NPrinting 16 which is older brother, no longer supported having different interface.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Loreline
Contributor II
Contributor II
Author

Hello @David_Friend, if you are referring to setting a Data Member yes I did, and having the variable in the report as opposed to just in the variables list yes I did in a label box. Also the variable has the "=" sign in the QS app.

For the Data Member I choose the same level I what I use in the template which is the location field, as shown in my print-screens.

Did I miss something else?

Loreline
Contributor II
Contributor II
Author

Hello @Lech_Miszkiewicz, thank you for the link. In the article a table from the QlikSense app is used as a level in the NP report. In my case I already use the field location as a level in my template, could it be the problem? If yes what should I use instead? 

Because the rest of the process explained looks the same as what I followed (creating a formatting rule, setting the level as not visible etc.).

I have applied the rule to the DetailReport with the location field with the image box visible and also tested not visible but it doesn't work. When I set the default visibility of the image Yes it is always shown in the report, no matter if the variable is 0 or 1. And vice versa if I set the default visibility of the image to No it is not shown in the report, no matter if the variable is 0 or 1. 

Loreline
Contributor II
Contributor II
Author

Hello @JonnyPoole, I am testing your technique in a new report. It works with each field as a level and the relevant image in each level. But I want the image to be at the same place on the generated report. Is it possible?

Thank you

JonnyPoole
Employee
Employee

Is it moving around vertically? Perhaps a <deleterow> tag is needed? Or include an extra row?  If you have a screenshot of the movement feel free to share.

Loreline
Contributor II
Contributor II
Author

I attached a first screenshot of the template in the designer with each image in a different level. And a second screenshot of two reports.

I would lik ethe logo to be at the same space no matter the langague chosse. But I cannot overlay the two images in the designer and be in different levels.

I don't know a lot about PixelPerfect, how could I use a <deleterow> tag here?

Thanks

JonnyPoole
Employee
Employee

I think <deleterow> is only available for excel templates actually. I don't design a lot with pixelperfect. I'll try to reproduce the problem and come up with a workaround.