How to Decode HTML Code in XMPro Workspace

How Can We Help?

< Back

Background

Decode Escaped HTML code eg &lt;br/&gt; which is displayed as <br/> in XMPro workspace rather than inserting a break line solution.

Steps

  • As an example, consider the below query:

select cast(u.FirstName + ‘ ‘ + u.LastName + ‘ – ‘ + CONVERT(nvarchar, ptr.Hours) + ‘<br/>’ as varchar(255)) as [ResourceHours]
from tsh_Master_ProjectTask pt
inner join tsh_Master_Project p on p.Id = pt.ProjectId
left outer join tsh_Master_ProjectTaskResource ptr on ptr.TaskId = pt.TaskId
left outer join fcUser u on u.RoleID = ptr.ResourceId
where pt.ProjectId = @ProjectId and ptr.Active = 1) tmp
where mpt.TaskId = tmp.TaskId
FOR XML PATH (”)), 1, 2, ”) as Resource

HTML Query Result: Harsha Kandalam – 10 &lt;br//&gt;Nelius Jordan – 8 &lt;br//&gt;Chun Wong – 6 &lt;br//&gt;

  • Map the query HTML result to a reference label.
  • Use HttpUtility.HtmlDecode(REFERENCE VARIABLE).ToString() to decode and set the actual value back to the label.
Comments are closed.

This is the legacy version of the XMPro Documentation site. For the latest XMPro documentation, please visit documentation.xmpro.com

X