BookmarkSubscribeRSS Feed
Gabriel_Lores
Fluorite | Level 6

I am using Visual Investigator 10.6 and I need to print a field that contains HTML tags as Output. Not as text. For example: I insert field value in Print Template as {{values.Name}} and Name value is "<strong>Pablo</strong>" (loaded in Entity by using Rich Text Input control). Is it possible to render this value as HTML in print template? I mean to see it actually in bold? I tried many ways but always get the same result. It is printed literally as: <strong>Resultado 1</strong>.

5 REPLIES 5
Rachel_
SAS Employee

I don't believe it's possible to have those tags in the name function as html in the print template, but could you use a workaround like this? 

{{(values.Name).replace("<strong>", "").replace("</strong>","")}}

That should strip out the <strong></strong> tags so only the name is shown on the print template, and then you can make it show as bold using the print template functionality.

Gabriel_Lores
Fluorite | Level 6

Thank you Rachel. My problem is that my real need is more complex than the example I used. Users want to have a text field where to write their conclusions on a Case they are investigating. So, they want to use a Rich Text Input control in the Case web page, in order to edit a large amount of text as they want. Finally they want the Case Print Template to show exactly the text as they edited. But Print Template shows the html tags as plain text. I need Print Template to render html tags as output.

Rachel_
SAS Employee

I've just looked into this more and I think I was able to do what you're asking for. Are the fields that use the Rich Text Input control in your Case entity marked as "Contains HTML"? If not, try selecting that option for those fields. You might then need to remove and then re-add those fields to your print template for the code to update. 

Gabriel_Lores
Fluorite | Level 6

Yes, my field is marked as "Contains HTML". I also removed and re-added the field in Print Template. But I still see it as plain text. Like this: <p><strong>Resultado 1</strong></p><p><strong>Resultado 2</strong></p><p>Este resultado indica lo siguiente.</p>.

Rachel_
SAS Employee

Hi, at this point I'd probably recommend opening a technical support track for this issue, here's the link to open one: https://support.sas.com/en/technical-support/contact-sas.html