We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

RTF to HTML using SSRS Reporting Services


I am trying to use the Aspose.Words_17_1_0 version to have the RTF data coming into my report convert to HTML (making the textbox placeholder HTML), and certain things will not render in the report viewer.

Converting RTF to an HTML “file” works just fine and display great in a browser, but the HTML tags it creates does not work for reporting services.

Two main things that do not work in SSRS are italics are underlines. Instead of and tags, your conversion is instead producing span tags, like this:

This sentence should be italic.

Am I using the wrong product?

Here is the code I am using to convert the RTF to HTML.

SSRS Textbox Expression:

Report Code Behind
Public Function AsposeConvertRTFtoHTML(ByVal mRTFData as String) As String
Dim mHTML As Byte() = Convert.FromBase64String(MyDLL.MyClass.AsposeConvertRTFtoHTMLBase64String(mRTFData))
AsposeConvertRTFtoHTML = System.Text.Encoding.UTF8.GetString(mHTML, 0, mHTML.Length)

Dim mFixHTML as string = AsposeConvertRTFtoHTML.Replace(" ", " ")

AsposeConvertRTFtoHTML = mFixHTML

Return AsposeConvertRTFtoHTML
End Function

The Function that I call in my signed DLL that calls Aspose.Words

Public Class MyClass
Public Shared Function AsposeConvertRTFtoHTMLBase64String(ByVal rtfString As String) As String
AsposeConvertRTFtoHTMLBase64String = Nothing
Dim mMS As New System.IO.MemoryStream
Dim mMS2 As New System.IO.MemoryStream
Dim enc As New System.Text.UTF8Encoding

Dim arByteData() As Byte = enc.GetBytes(rtfString)
mMS.Write(arByteData, 0, arByteData.Length)

Dim doc As New Aspose.Words.Document(mMS)

doc.Save(mMS2, Aspose.Words.SaveFormat.Html)

Dim result As String = Convert.ToBase64String(mMS2.ToArray())

AsposeConvertRTFtoHTMLBase64String = result
Return AsposeConvertRTFtoHTMLBase64String

Catch ex As Exception
End Try
End Function
End Class

I have attached 3 files. The 1st is a test of my Function that displays the results in a web browser control, which looks fine. The 2nd is what it looks like in my reporting services. The 3rd is the entire rendered HTML file.


Thank you in advance!
James Moore

Hi James,

Thanks for your inquiry. As per my understanding, you want to export underline, italic, and bold text in , , tags instead of span tag using Aspose.Words for .NET. We have logged this feature request as WORDSNET-14916 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.
Hi James,

Further to my last post, we have logged a feature request as WORDSRPT-248 in our issue tracking system to export formatted HTML (span tag with style attribute) in output document. Our product team will look into the possibility of implementation of this feature. Once we have any information about this feature, we will update you via this forum thread.

We apologize for your inconvenience.


Thanks for your reply. Actually, it really isn’t about “exporting”. I was just under the impression that your software would allow me to interpret RTF to HTML that the HTML placeholder of a SSRS report could interpret. That is why I was reviewing your product.

Thank you,
Hi James,

Thanks for your feedback. Your requirement is related to WORDSNET-14916. You will be notified via this forum thread once this feature is available.

Please let us know if you have any more queries.