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: 
Danijel
Partner - Creator III
Partner - Creator III

Hyperlink from Qlik Sense not working

Hello all,

We have in a Qlik Sense application within a table a field with a url. This field is also displayed as url and works within the Qlik Sense application (Feb 2022 Patch1).

Now we distribute this tab as html report within an email (NP May 2021 SR4). There the "link" is no longer displayed correctly. Only the name "Link" is displayed as hyperlink.

I have already tested it with HTML Encode, as well as a formula within the report.

My HTML code is:
<td valign=top height=25 width=150> <a href="%%url_1%%">Link</a> </td>

Does anyone have any other ideas?

Greetings

 

 

Labels (2)
19 Replies
Ruggero_Piccoli
Support
Support

Hi,

Create a Qlik Sense table as you did:

Ruggero_Piccoli_0-1649670248204.png

Hyperlinks:
LOAD * Inline [
    Site, URL, Hyperlink
    Google, https://www.google.com/, <a href="https://www.google.com/">Google</a>
    Qlik, https://www.qlik.com/, <a href="https://www.qlik.com/">Qlik</a>
]

Create the Qlik NPrinting connection and cache as usual then create an HTML template:

Ruggero_Piccoli_1-1649670437290.png

I set Show Headers to Hide just for esthetic reasons but you have to remove the Keep Source Format flag to avoid uncontrolled HTML style code in the generated report.

The generic HTML link has the structure (from https://www.w3schools.com/tags/tag_a.asp)

<a href="https://www.w3schools.com">Visit W3Schools.com!</a>

 so I generated the second column by building the link using Qlik NPrinting tags

<td><a href="%%URL%%">%%Site%%</a></td>

Instead the third column is made by generating the HTML tag in the Qlik Sense reload script. This keeps very simple the template side

<td>%%Hyperlink%%</td>

Run a report preview

Ruggero_Piccoli_2-1649670914165.png

and you will have the HTML code generated in both cases.

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

@Danijel
 

Also, in the load script editor, I wrapped the urls with double quotes, reloaded the NP connection, previewed the your html report in the template editor and suddenly the links worked with your NP report output.

 

Sites:
LOAD * INLINE [
   Site, url
   google, "https://www.google.com"
   qlik, "https://qlik.com"
];

 

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Frank_S
Support
Support

Thanks @Ruggero_Piccoli for your invaluable input as always!

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

Hello @Frank_S  and @Ruggero_Piccoli 

thanks for your effort, great suggestions!

I have taken a closer look at Frank's suggestion. Since the url comes from the source system in a field, the must add the " separately.

My idea was to use the chr(34), unfortunately within QS I get a wrong representation of the url displayed, which of course doesn't work either.

Do I have a thinking error somewhere here?

 

url2.png

 

something else interesting:

when I select, the content is displayed correctly. However, QS does not seem to interpret the link function of the url correctly.

 

url3.png

Frank_S
Support
Support

Hi @Danijel

I see...

Well there seems to be alot of discussion around that on the internet

I'll cc @Ruggero_Piccoli in case he has any other ideas on this. 

 

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

Hi @Frank_S  @Ruggero_Piccoli ,

I have tested something else. I have made some progress with the ApplyCodePage function. With this I apparently don't need the " anymore.

Last problem, as soon as I enter a link label, I get the label as a value in NP, if this is left empty, the link is correctly displayed and can be called.

Can anyone of you confirm this?

 

url4.png

Frank_S
Support
Support

@Danijel

Not sure what you mean by "as soon as I enter a link label, I get the label as a value in NP"

 

However what I did notice is that regardless of what I type into the link label field, "link" appears in the email report output regardless of what is typed into the label field. 

Also if I leave the field 'blank', Link is still shown in the output.

 

In both cases the links works whether I use a link label or leave it blank.

 

 

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

Hello @Frank_S 

thank you for testing. I have made a short video about this, which again shows my procedure.

I will send you the video via pm.

Frank_S
Support
Support

Hi @Danijel

 

I wasn't able to find any other alternate solutions despite a concerted effort to do so over the past few days and including today.

Wrapping your urls with double quotes and using 'text' rather than 'link' to represent the url data in the QS app works perfectly.

You also need to deselect 'keep source formats' on the url field.

Here below is  representation of the changes I made directly to the app in the QS hub editor. I am also attaching the source file is used.

 

 

Kind regards...

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

Hi @Frank_S 

Thank you very much for your effort. I will also test it again and get back to you.

Greetings