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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
apoorvasd
Creator II
Creator II

Issue with stripHTML function in QlikView

Hello Everyone,

I am trying to eliminate html codes from my data using stripHTML function. I am using the below macro for the same,

Function stripHTML(strHTML)
'Strips the HTML tags from strHTML

Dim objRegExp, strOutput
Set objRegExp = New Regexp

objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "(?:<style.+?>.+?</style>|<script.+?>.+?</script>|<(?:!|/?[a-zA-Z]+).*?/?>)"

'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")

'Replace all < and > with &lt; and &gt;
strOutput = Replace(strOutput, "&lt;", "<")
strOutput = Replace(strOutput, "&gt;", ">")

stripHTML = strOutput 'Return the value of strOutput

Set objRegExp = Nothing
End Function

The issue is, when I reload the report locally in my server, the report executes without any errors, but when reloaded on QMC, I get the below error

PR error msg.PNG

Any guesses what could be the possible reason for this? 

Thank you.

10 Replies
Brett_Bleess
Former Employee
Former Employee

I have a hunch I know what the issue is, believe it should be that the QlikViewBatch Settings.ini is missing the following setting:

AllowMacroFunctionsInExpressions

That would need to have an =1 to be activated there.  The setting will not be there, you will have to manually add it as follows within the [Settings 7] area:

AllowMacroFunctionsInExpressions=1

I believe that should get things working when you run it via Publisher/Reload Engine task.  Hopefully this does the trick, I believe you should have had to have changed this in the client settings as well though, so I am a bit puzzled there! 🙂

Regards,
Brett

PS, helps if I remember to give you the path to the Settings.ini! 🙂  Sorry about that:

C:\Windows\System32\config\systemprofile\AppData\Roaming\QlikTech\QlikViewBatch\

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.