I am trying to write out custom HTML in an SSRS report. If I try to put the html in a placeholder (selecting Markup type = “HTML – Interpret HTML tags as styles”), SSRS will strip out any unsupported tags. Therefore, I am trying to write it out in custom code. My expression is as follows:
=Code.WriteHTML("<b>ryantest</b>")
My custom code is as follows:
Function WriteHTML(ByVal Msg As String) As String
If Not (IsNothing(System.Web.HttpContext.Current)) Then
System.Web.HttpContext.Current.Response.Write(Msg)
End If
End Function
When I try to view the report, I get the following error:
An error occurred during client rendering.
Exception of type 'System.OutOfMemoryException' was thrown.
Any ideas?
I spoke with Microsoft. Their rendering engine has no way of supporting custom HTML. The only approach is to inject the HTML after SSRS is done processing the report or write your own rendering extensions.