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: 
Bernardvanecek
Contributor
Contributor

HTML table background color issue(using variables/formulas)

Dear users/admins,

I have a bit of a stumper regarding HTML email report using Nprinting in connection with Qlik Sense. 

For start I am using latest versions of Qlik Sense and Nprinting.
In Qlik Sense I have prepared(via SQL) data from which I've made basic table consisting of weekly data(columns:Mon, Tue, Wed etc.)There I have used background color expression to color always a previous day for which I have data colected:

If(WeekDay(Today()-1)='Mon',rgb(225,202,08))-%%ColorVariable%%

In Qlik Sense this works perfectly but when I'm trying to prepare email report via HTML I have a huge problem with applying my "if" clause in variable. 

To put together table in Nprinting I am forced to use single cells(any other options like inserting table is in this case excluded due to my data set-%%CellCoordinates%%)). Thanks to this I have found out an issue I can't evade - %%ColorVariable%% and %%CellCoordinates% can't function together properly. In fact if I put those together coloring stops to function and leave the cells white only with desired value.
If I delete %%CellCoordinates%% and leave it empty or put there a static value, %%ColorVariable%% starts to work. 
Example here:

Both:

Both codesBoth codes

 

Only color:
Only colorOnly color

 

 

Is there any solution to this problem?

Thank you for your advice

Bernard

Labels (2)
1 Reply
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Bernard,

I would get back to drawing board. It is very important to build your data source right for use with NPrinting. Your current approach will not work. Your variable will not be evaluated as per documentation: https://help.qlik.com/en-US/nprinting/September2019/Content/NPrinting/Troubleshooting/Variables-dont...

the options you have are basic and are limited to use of the table entity tag instead of cell entity tag and then either keep source format or pass colour code as value calculated in corresponding cell on the same row. See topic below:

https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Nprinting-HTML-How-change-background-color-... 

As I always say - NPrinitng development in 95% QlikView / Qlik Sense development and 5% of putting template together). 

I am not sure about your statement: To put together table in Nprinting I am forced to use single cells(any other options like inserting table is in this case excluded due to my data set..... to be frank I actually don't believe it as for NPrinitng purpose you can build an object which will well suit NPrinting HTML template and purpose it needs to serve there, but not necessarily will be usable for users in Qlik Sense due to layout required.

This is often a practice where we need to build dedicated objects only for NPrinting reports.... those objects can be hidden in container so users will not see it when accessing app. 

https://nprintingadventures.wordpress.com/2019/10/15/whats-new-in-nprinting-september-2019/

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.