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: 
adang
Contributor III
Contributor III

HTML table styling does not work with with "Keep Source Formats"

Like the title said; HTML styling like border lines, padding space do not work when "Keep Source Format" is checked.

This is quite an issue when the values are formatted with text colors, bolden font when certain conditions are met and could not be recreated in NPrinting. The Qlik formatting will not be preserved when disabling Keep Source Format. 

Has anyone here found a way to get around this?

Labels (2)
19 Replies
Ruggero_Piccoli
Support
Support

Hi,

Could you share some screenshots of the template structure?

Are you importing the source table as a single tag? Did you tried to follow @Frank_S 's suggestion and create a native HTML table with borders defined in HTML and inserting Qlik NPrinting column tags in it?

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
adang
Contributor III
Contributor III
Author

a native HTML with borders defined is what I created. But the styling defined in the tags won't work until I disable "Keep Source Format". 

adang_0-1642607914344.png

 

adang
Contributor III
Contributor III
Author

@Ruggero_Piccoli : do you see any issues with the HTML code? it works if I disable "Keep Source Format" but that will take away the conditional format coming from Qlik on the line items; which I am not seeing a way to create in HTML.

Lech_Miszkiewicz

Hi @adang , @Ruggero_Piccoli , @Frank_S 

This is my example:

Simple table in Qlik Sense with:

  1. Dimension 1 = Dim1
  2. Dimension 2 = Dim2
  3. Measure: Sum(Expression)
    1. This measure has variable vTextColour set as font/text colour
    2. This measure has vcariable vBackgroundColour set as cell background colour
  4. Measure which shows me what is the font/text colour RGB value
  5. Measure which shows me what is the background colour RGB value

Lech_Miszkiewicz_0-1642806091962.png

I bring this table to HTML Report and as shown on the picture I use Dimension 1, Dimension 2, and Measure to build my table content and another 2 columns I use to populate style values by passing their respective tags as marked on screenshot:

  1. font color as $(vTextColour) column from my Qlik Sense table
  2. background color as $(vBackgroundColour) column from my Qlik Sense table

Please note that for style I had to disable HTML Encode parameter as shown on screenshot

Lech_Miszkiewicz_1-1642806564995.png

 

When you preview my template you get this - table where every cell can be controlled conditionally based on values calculated in Qlik Sense.

  1. Lech_Miszkiewicz_2-1642806806689.gif

     

I said from the very beginning that this requires planning and appropriate design but certainly is possible.

cheers

Lech

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.
adang
Contributor III
Contributor III
Author

Thank you @Lech_Miszkiewicz ! This is something that I had not known about until you showed me how to do it in details like this. I will give it a try and let you know the outcome! 

Lech_Miszkiewicz

Hi @adang 

HTML does not look at line but... there is big BUT....

you can expose value of the colour in line by calculating it in Qlik and passing it down to HTML template as actual colour value. 

I wrote whole step by step process on how to achieve this below.

so - yeah, this definitely is possible.

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.
Lech_Miszkiewicz

@adang let us know how you go - good luck

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.
Lech_Miszkiewicz

by the way - you may be interested in reading this as well - this is completely a whole different concept i wrote on how to utilize nprinting and passing through whole html code using qlik sense measure: 

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

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.
Ruggero_Piccoli
Support
Support

Thanks @Lech_Miszkiewicz for sharing this solution!



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
adang
Contributor III
Contributor III
Author

Your solution on the line item formatting in HTML works! Thank you @Lech_Miszkiewicz !

About the pivot table in HTML, it's a very creative approach! And I think it's the best approach if you have an undefined list of dimensions.

In this very same project, I found a quick and easy way to get this done. Since I have three specific values for the dimension, I just created a metric calculated specifically to a dimension value, and use <th> tags with colspan style to create a fake pivot table like in the screenshot. 

adang_1-1643035226126.png