Tuesday, November 20, 2012

Telerik Report: RendererNotAvailableException... rendering format is not available

Scenario: I am trying to export the report programmatically
Feature: Telerik Reporting export feature
Error Message: "RendererNotAvailableException... rendering format is not available" for the following formats:

- DOCX
- HTML
- PPTX 
- XPS

Code Snippet: 
Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport(format, reportToExport, deviceInfo);
 reportBytes = result.DocumentBytes;
 if (reportBytes != null && reportBytes.Length > 0)
                Mailer.SendNotifications(_report, reportBytes);

Solution:
As noted in the Deploying Applications using Telerik Reporting help section, the DOCX/PPTX/XLSX rendering extensions require Telerik.Reporting.OpenXmlRendering.dll and Open XML SDK 2.0 for Microsoft Office (DocumentFormat.OpenXml.dll v.2.0.5022.0 or above).

The XPS rendering extension requires Telerik.Reporting.XpsRendering assembly (Telerik.Reporting.XpsRendering.dll). In both cases your project should be targeting .NET 3.5 Framework or above.


If just adding the DocumentFormat.OpenXml.dll does not work, then, the

Open XML SDK 2.0 for Microsoft Office must be installed first on the server.

If still, it doesn't work, check the project that references to the project where Telerik Reporting is originally referenced. That project also needs the mentioned DLLs.