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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exporting table as htm file

I have a straight table which I export as an htm file. (I intend to use a macro for this eventually) The problem is that I have an embedded link in one column that should be an active link when the file is opened in a browser.

The issue is that when  this column is written out:

'<a href="http://www-tac.company.com/Teams/ks/c3/casekwery.php?Case=' &  max(INCIDENT_NUMBER) & '"><' &  max(INCIDENT_NUMBER) & '></a>'

It becomes this - note the &Lt; and the &quot; in place of < and "

&lt;a href=&quot;http://www-tac.company.com/Teams/ks/c3/casekwery.php?Case=637165403"><637165403></a>

when I check the htm file.

If I change the &lt; to <    and the &quot;  to "   in an editor it will work as a link when opened in a browser.

I'm assuming that Qlik htm interpreter is changing a " to &quot; 

My question is is there any way around this and to make the link show up as code that a browser understands.

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

I could not find a workaround in Qlik, so I used this short Python Code to parse the file. It replaces the strings as shown in the code

import fileinput

for line in fileinput.FileInput("testHyperlink14.html",inplace=1):

    line = line.replace('&quot;', '"')

    print line,

for line in fileinput.FileInput("testHyperlink14.html",inplace=1):

    line = line.replace('&lt;', '<')

    print line,

for line in fileinput.FileInput("testHyperlink14.html",inplace=1):

    line = line.replace('&gt;', '>')

    print line,

View solution in original post

1 Reply
Not applicable
Author

I could not find a workaround in Qlik, so I used this short Python Code to parse the file. It replaces the strings as shown in the code

import fileinput

for line in fileinput.FileInput("testHyperlink14.html",inplace=1):

    line = line.replace('&quot;', '"')

    print line,

for line in fileinput.FileInput("testHyperlink14.html",inplace=1):

    line = line.replace('&lt;', '<')

    print line,

for line in fileinput.FileInput("testHyperlink14.html",inplace=1):

    line = line.replace('&gt;', '>')

    print line,