在SQL SERVER Reporting Services(SSRS)中显示rtf数据

时间:2013-06-03 15:25:02

标签: c# reporting-services ssrs-2008 rtf

我试图在SQL SERVER Reporting Services(SSRS)中显示rtf数据。 我有Visual Studio 2010和ReportViewer版本10.0.0

rtf数据存储在我绑定到SSRS报告的数据集中。

我添加了以下对报告参考的引用    System.Windows.Forms的 在SSRS报告中的文本框表达中,

=Code.ConvertRtfToText(Fields!colInfo.Value)

以下代码我已放入报告代码属性

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

我得到的输出是

{\rtf1\ansi\ansicpg1252\uc1 aaa}

1 个答案:

答案 0 :(得分:0)

该函数看起来应该将rtf转换为纯文本。您的输入数据不可能被意外“双重转换”为rtf,即您的功能输入

{\rtf1\ansi\ansicpg1252\uc1 \{\\rtf1\\ansi\\ansicpg1252\\uc1 aaa\}} 
是吗?如果没有,请提供功能输入以进行比较。