Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Lauri
Specialist
Specialist

Conditionally hide HTML table row

I've created an NPrinting HTML report that contains an HTML table based on a straight table in Qlik Sense. It works fine. Now I would like to hide one column in NPrinting based on a condition. I created a formula that returns an HTML row if the condition is met, else an empty string:

=If(Include='bh', '<td style="border-collapse:collapse;border: 1px solid;text-align: left;">%%Site%%</td>','')

But the result, in an email, is all messed up.

Is this possible in an HTML report or do I need to use PixelPerfect instead?

Note that I'm on NPrinting Feb 2024 SR3 but that's not an option in the dropdown menu.

Labels (2)
4 Replies
rubenmarin

Hi, hard to know without seeing an example of what's happening, just guessing that maybe you also need to set the condition on the tr (and th if used) so everything fits.

It has passed a long time since the last I did but it's possible to set conditional columns, I don't remember exactly how I did it, and I don't have access to check it now, but it's possible with html reports.

Frank_S
Support
Support

https://community.qlik.com/t5/Official-Support-Articles/Qlik-NPrinting-Conditionally-display-a-label...

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

My solution to this is to create whole html in the table and create content by passing it to template. 

See this blog post to get an idea about the approach: 

https://nprintingadventures.com/2020/04/24/how-to-build-html-pivot-table-in-nprinting/

once you read through this you will see that it is possible to move whole logic into content of the cell which we then pass without html encoding. That would be the approach I would use. Table in post meant to mimick pivot table making it a lot more complex. Straight table approach is much simpler in that regard so it should be relatively easy.

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.
Lauri
Specialist
Specialist
Author

Thank you, Lech. That looks like a great solution and I will try it out soon(ish).