Free Reporting Services Utilities

RTF to HTML conversion library

Reporting Services 2008 and above have support for displaying fields containing HTML formatted data. However there is no support for displaying RTF formatted fields. By converting RTF data to HTML format you can display the data in your report. Download PebbleReportsSsrsUtils.zip and use the custom assembly in your report.

Step 1. Install the custom assembly

Copy PebbleReports.SsrsUtils.dll to the same directory as MSReportBuilder.exe. For example:

copy PebbleReports.SsrsUtils.dll "C:\Program Files (x86)\Microsoft SQL Server\Report Builder 2.0\"
Before deploying the report to Report Server the assembly should be installed on Report Server too.

Step 2. Add a reference to the assembly

In Report Builder open the Report Properties dialog. (Right-click on the blue background just outside the page outline and click Report Properties.) In the Report Properties dialog click on References tab. Then under "Add or remove assemblies" click the Add button and add PebbleReports.SsrsUtils.dll.

Step 3. Add the RTF field to your report

Drop your RTF field into the report body. A textbox is added to your report.

Step 4. Edit the expression

Right-click on the <Expr> in the textbox and click Expression. Then edit the expression as follows: If Fields!Comments.Value is the field containing RTF data (this field must be a byte array) then use this expression to convert RTF to HTML:

=PebbleReports.SsrsUtils.Rtf2Html.ConvertRtfToHtml(Fields!Comments.Value)

Step 5. Set Placeholder markup type

Click on the <Expr> in the textbox, and when it becomes blue right-click on it and click Placeholder Properties. In the Placeholder Properties dialog set markup type to HTML.

Step 6. Run the report

That's it! Press F5 to run the report.

Additional instructions

The following additional steps are needed for Server and Visual Studio (thanks to Michelle D. from Australia):
Copy PebbleReports.SsrsUtils.dll to:
* C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin\
* C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\
 
Edit:
* C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\rssrvpolicy.config
  after the (last or 2nd last code group that has Description="This code group grants SharePoint Server code full trust.)
              <CodeGroup
                      class="UnionCodeGroup"
                      version="1"
                      PermissionSetName="Execution"
                      Name="PebblesReports.SsrsUtils"
                      Description="A special code group for my custom assembly.">
                <IMembershipCondition
                        class="UrlMembershipCondition"
                        version="1"
                        Url="C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin\PebbleReports.SsrsUtils.dll"
                                />
              </CodeGroup>