Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
I think I've successfully tested something.
In this sample I have 2 different detail-reports one for each level placed sequentially after each other. These contain the boolean levels (actually 1 value or null so technically not boolean). I put text tags in seperate 'detail' sections before and after the 2 levels
for both detail-report (level) sections I had to toggle the highlighted property to 'no' ("Print when Data Source is Empty")
Then, when one level resolves to no values and the other resolvers to 1 value. The missing section is collapsed, and the 'detail' sections around the levels collapse to before and after the chart (in your case logo).
Hello @JonnyPoole, thank you for that it works when I only have the levels per language. But it doesn't work when I add a level based on my location field, which is required. I have reordered the levels in different ways but I never end up with the correct result.
No matter what I put in the DetailReport band at logo level, it doesn't appear when I generate the report.
Would you have an idea what to do?
Thank you
I'm going to take a step back to contrast my sample with your desired output:
In My example:
- The report conditionally shows 1 of 2 objects based on a filter
- Each object (2 in total) requires their own level in the pixel perfect template
- Therefore there will be 2 'DetailReport-level' bands added into the pixel perfect template
- Both 'DetailReport-level' bands need to have the 'print when data source is empty' property set to 'No'.
In order to adapt this to your use case which has 3 languages and 3 different logos, I anticipate that you require:
- The report conditionally shows 1 of 3 objects based on a filter
- Each object (3 in total) requires their own level in the pixel perfect template
- Therefore there will be 3 'DetailReport-level' bands added into the pixel perfect template
- All 3 'DetailReport-level' bands need to have the 'print when data source is empty' property set to 'No'.
I think you said this is WORKING now for you. Is that correct? If so, it also sounds like you need to do this again with another field 'location' but you can't get that to work. If that is the case, I would duplicate the report and try to do it JUST with location first to see if the same technique works for location when language is not already in the level show/hide. The answer to that question will allow us to understand if there is an issue with location specifically or if its a broader issue with applying 2 separate sets of levels to the structure of the report.
Hello @JonnyPoole,
I know I will need 3 levels for the 3 languages but here I am just testing with 2, because if it works with 2 it should be no problem with 3. The 'DetailReport-level' bands for the logos have the 'print when data source is empty' property set to 'No'. The location level is set to 'Yes'.
The report works properly with only the location level. That's how it was set up in the first place and now I am asked to add the logos.
The problem is that the text and logo I insert in the DetailRerpot for the language level don't show up when I generate the report. Only the part under the dotted line (of the Detail3 in my Screenshot_16 for example) appears.
Also in the PDF the same sheet is duplicated 12 times even if only one product and one location are selected in the QS app. When I do the same selection and run the "old" pixel report without the logo levels the PDF has only one page, which is correct. I thought it may come from the fields to cycle of the report which I didn't touch and are from the "old" version without the logo on field Year_Quarter, Plant and Language. To test I added the field Logo but no change, I tried added the 3 Show_logo_G/F/I fields (Screenshot_13)
Ok that answers my question -> It worked with location only and it also worked with language logo only. It fails when doing both together.
I'll see if I can add to the sample provided to have 2 sets of boolean hide/show levels like you need. I'll report back if I find some gotchas.
I added a 2nd set of boolean levels to try emulate what I think you are doing and it works. In my case I have 2 things I want to toggle each with 2 values. So there are 4 possible scenarios:
Show/Show-B
Show/Hide-B
Hide/Show-B
Hide/Hide-B
Here are some screenshots.
Here are the formulas that i add just for debug / development purposes.
This is how the selection state looks in the source app:
Please also note the 8! data islands to support this.
Created a lot of NP filters to test the scenarios. 8 filters in total. a show filter and a hide filter for each of the 4 boolean levels in nprinting
The filters are applied on the 'selection' / 'selection2' field for the first set of boolean levels and on 'selectionB' / 'selection2B' on the second set of boolean levels.
I set the 'print when data source is empty' property to none for all 4 levels in the template of course too:
Here is output for a show/hide2 and showB/hide2B scenario
It looks more complicate than creating 3 pixel perfect report for the 3 languages. The users will only need to choose the report they want in the on-demand button. What do you think?
I thought I would have find another solution than 3 reports but as I didn't get more reply from @David_Friend and @Lech_Miszkiewicz I might go with this option.
pros and cons for both methods. It's easier to comprehend the 3 simpler report approach on the NPrinting side but keep in mind the QS UI is made slightly more complex when you use 3 reports as I would think you need to create 3 on-demand buttons(intead of 1) + a conditional container show/hide to support conditionally showing 1 of the 3 buttons depending on the user's selection state.
If you need to change the report in the future, it could be nice to just have 1 report to change too.
There are probably other pros/cons. Having been through the development of the single report approach I feel comfortable I could script the auto-generation of the data islands quite easily and I would probably hide them using hideprefix. The only pain is the 1 time pixelperfect authoring.
Since your case is on-demand, you can skip all those 8 NP filters which is a bonus too.
Also... the original reason why I titled that blog post I referenced last week : "The Multi-Report NPrinting template" is that the technique does just that: allow you to design multiple reports in one template.
@Loreline - i didnt comment because I had nothing extra to add to this to be honest given that solution is possible and yes it is complicated and @JonnyPoole answered all your questions same way I would.
One thing I dont agree with Jonny is that I would straight away do 3 templates.
It is much less complex to create 3 OnDemand buttons and handle conditional hide/show of them in container than build 1 report with 3 sections and conditionally manage those sections visibility in Pixel perfect report. People are lot ore familiar with containers than with PixelPerfect reporting.
Working in 3 individual pixel perfect reports will be much easier for someone new to this template and at the end it is exactly the same amount of work as you still maintaining 3 versions of the report and for each version you maintaining objects. The only thing is that the allignment could be simplified when you have all in one report but that can be managed by pixel perfect approach to sizes of your object.
regards
Lech