4
votes

I am trying to show rtf Data in SQL SERVER Reporting Services (SSRS). I have Visual Studio 2010 and ReportViewer Version 10.0.0

The rtf data is stored in the dataset which I am binding to the SSRS report.

I have added following reference to Report References System.Windows.Forms In Textbox Expression in SSRS-Report,

=Code.ConvertRtfToText(Fields!colInfo.Value)

Following code I have put in Report Code properties

Public Shared Function ConvertRtfToText(ByVal input As String) As String 
Dim returnValue As String = String.Empty
Dim converter As New System.Windows.Forms.RichTextBox()
converter.Rtf = input.Trim 
returnValue = converter.Text 
Return returnValue 
End Function

The Output I get is

{\rtf1\ansi\ansicpg1252\uc1 aaa}
1
Yes. But, I could not find the config file. Moreover, I wonder what it has to do with SQL Server config as such. I am using SQL CE. but, this is something related to a document text to be shown in reports!Ravi
Can you please share answer of above question, facing same issueVidhi

1 Answers

0
votes

That function looks like it should convert rtf to plain text fine. It's not possible your input data was accidentally "double converted" to rtf, i.e. the input to your function was

{\rtf1\ansi\ansicpg1252\uc1 \{\\rtf1\\ansi\\ansicpg1252\\uc1 aaa\}} 

is it? If not please provide the input to the function for comparison.