in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

kwanl's blog

Writing a Rendering Extension for Reporting Services 2005

One glaring omission from the out-of-the-box SSRS 2005 output formats is plain text ASCII. I know there is a CSV option available but CSV is primarily used for data-interchange. My goal was to create a custom rendering extension to output reporting services reports as attractive as possible in plain text ASCII.

Conceptually, the process is simple, you provide a class that implements the Microsoft.ReportingServices.ReportRendering.IRenderingExtension interface and add an entry to the rsreportserver.config file for your assembly.

 

Implementing IRenderingExtension

The IRenderingExtension interface is really straight-forward and there are only a few methods you have to implement with Render and RenderStream being the most important (and challenging).

Modifying rsreportserver.config 

The rsreportserver.config file controls various settings for the Report Server including which extensions are available. To add a rendering extension, you add a new Extension element under the Extensions/Render element.

For example, this adds an extension for a rendering extension name SimpleRenderer.Class1 in the assembly SimpleRenderer.dll. 

 <Extension Name="Kwan" Type="SimpleRenderer.Class1,SimpleRenderer" Visible="true" /> 

In addition to modifying the configuration file you need to make sure your assembly is fully trusted. This is because the classes in Microsoft.ReportingServices.ReportRendering only support fully trusted callers. There are several ways to do this but the preferred method is to update the policy file to give your specific assembly full trust.

 

Add the following to your rssrvpolicy.config (specifying the public key blob for your assembly):

                            <CodeGroup
                                    class="UnionCodeGroup"
                                    version="1"
                                    PermissionSetName="FullTrust"
                                    Name="SimpleRenderer_Strong_Name"
                                    Description="This code group grants SimpleRenderer code full trust. ">
                                <IMembershipCondition
                                        class="StrongNameMembershipCondition"
                                        version="1"
                                        PublicKeyBlob="..."
                                />
                            </CodeGroup>
 

Comments

 

Clayton said:

Any issues in deploying custom renderers to a Sharepoint Integrated Reporting Server?

June 21, 2007 1:54 PM
 

Terrier said:

Do you have sample that works?  The sample here: msdn.microsoft.com/.../CustomRenderers just gives a "Cannot Open Closed Stream"  error on Export.

September 10, 2007 12:52 PM
 

Mark C said:

So where can I get this TEXT renderer for Reporting services?

November 26, 2007 1:28 PM
 

hugo said:

The sample from the link above works, but you have to comment out the closing of the stream writer and the stream (closing the stream writer will close the underlying stream too) - the report server needs the stream to remain open so that it can read from it.

May 14, 2008 4:21 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts