Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
MarcoRaymundoKeyrus
Partner - Contributor III
Partner - Contributor III

How to insert HTML tags in HTML reports by variable

Hi!

I want a generate list like this:

  • Apple
  • Banana
  • Orange

I created a variable to include a message in the body of the email.
SET vList = = Concat (Aggr ('<li>' & MYFIELD & '</li>', MYFIELDAGGR));

In the HTML report, I created the following structure:
<ul> %% vList %% </ul>

In NP 16 it worked perfectly, generating the list, like above.

In NP 19 april, in the output file, the tags <li>;</li>, were converted to &lt;li&lt;/&

Does anyone know how to prevent NP when generating the HTML file to do this conversion?

Labels (2)
2 Solutions

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

This seems to behave as designed.. all objects (except table) use html encoding

If you want to pass text (without encoding) you may want to create a straight table, put your variable in it and use it as a source. In NPrinting desigenr table properties you would have an option to turn on/off encoding.

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.

View solution in original post

Ruggero_Piccoli
Support
Support

Hi,

I did many tests this morning and the only way that I found that works (in the meaning that < and > are kept and not replaced) is by inserting them directly in the HTML code of the template. 

I tested variables, formulas and straight table columns. In all cases the < and > are replaced and the report will be not correct. 

The workaround could be to create a straight table with the content of the formula without the <li> in a column, add that table in the Levels node and add the <li> tags directly in the template.

level.png

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.

View solution in original post

12 Replies
Frank_S
Support
Support

@MarcoRaymundoKeyrus 

Try this. If you use the variables inside the report itself using the list tags it works :

<html>
<body>
<ul>
<li>%%vQuarterMinusTwo%%</li>
<li>%%vHyperlink%%</li>
<li>%%vSalesman%%</li>
</ul>
</body>
</html>

list in NPrinting report.PNG

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
MarcoRaymundoKeyrus
Partner - Contributor III
Partner - Contributor III
Author

Thanks Frank!

Your approach solves when the variable results in a row.
My variable results in more than one line, something like:
=Concat (CITY, ',') -> City_1, City_2.
I need to use show the result as an HTML list using the <ul> <li> tags.
I tried with the variable (qlikview) and as an expression (nprinting), in both nprinting converts the characters "<,>" into their respective special codes: "&lt;,&gt;".
As a result the tags are not interpreted.

Try this: In HTML report, Create a nprinting expression ='<b>BOLD TEXT</b>'. Show the report.

I believe that in NP 16 there was no conversion of expressions and variables before inserting them in the html report. That apparently in NP 19 this conversion occurs.

Frank_S
Support
Support

Hi @MarcoRaymundoKeyrus 

Can you do what I did and show your work using snapshots?

Show an NP 16 (working example) and NP 19 (not working example) or visa versa.

I'm not sure I am following completely at this point any longer. 

Detail steps to reproduce the issue and snapshots will help me to visualize what you are experiencing here. Also show how it was working in the past. 

Thanks.

 

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
MarcoRaymundoKeyrus
Partner - Contributor III
Partner - Contributor III
Author

Follow the steps:

This is my variable in the qvw file:

NP19_HTMLCode_2.PNG

 

This my html report (NP19 april):

NP19_HtmlCode.PNG

 

Report generated:

NP19_HTMLCode_3.PNG

 

Report generated (code):

NP19_HTMLCode_4.PNG

 

The qvw file, expression, and html report are the same as I used with NP16. Which rendered the report "correctly".

Frank_S
Support
Support

Hey @Ruggero_Piccoli 

Can you have a look at this situation?

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

This seems to behave as designed.. all objects (except table) use html encoding

If you want to pass text (without encoding) you may want to create a straight table, put your variable in it and use it as a source. In NPrinting desigenr table properties you would have an option to turn on/off encoding.

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

I tested your tip and it worked.

Thank you!

MarcoRaymundoKeyrus
Partner - Contributor III
Partner - Contributor III
Author

@Frank_S 

Thank you for your attention and help, they were instrumental in solving my problem.

Hugs!

Ruggero_Piccoli
Support
Support

Hi,

I did many tests this morning and the only way that I found that works (in the meaning that < and > are kept and not replaced) is by inserting them directly in the HTML code of the template. 

I tested variables, formulas and straight table columns. In all cases the < and > are replaced and the report will be not correct. 

The workaround could be to create a straight table with the content of the formula without the <li> in a column, add that table in the Levels node and add the <li> tags directly in the template.

level.png

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.