This is a migrated thread and some comments may be shown as answers.

Error exporting to Rich Text Format

3 Answers 534 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gordon Buxton
Top achievements
Rank 1
Gordon Buxton asked on 04 Sep 2012, 09:34 AM
I have some reports embedded in my web forms application. They work fine, and the reports are produced when the parameters are entered, and they also export fine to various formats such as PDF or Excel, but when I try to export to Rich Text Format I get the following error:

Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.


Source Error:


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:




[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Reporting.RtfRendering.Table.RenderingElementCollection..ctor(RenderingElementContainer owner) +193
   Telerik.Reporting.RtfRendering.Table.RenderingElementContainer..ctor(ProcessingElement processingElement) +73
   Telerik.Reporting.RtfRendering.Table.Report..ctor(Report processingReport) +37
   Telerik.Reporting.RtfRendering.Table.RenderingElementFactory.CreateItem(LayoutElement processingElement) +176
   Telerik.Reporting.RtfRendering.Table.RenderingElementCollection..ctor(RenderingElementContainer owner) +217
   Telerik.Reporting.RtfRendering.Table.RenderingElementContainer..ctor(ProcessingElement processingElement) +73
   Telerik.Reporting.RtfRendering.Table.SubReport..ctor(SubReport processingSubReport) +36
   Telerik.Reporting.RtfRendering.Table.RenderingElementFactory.CreateItem(LayoutElement processingElement) +1244
   Telerik.Reporting.RtfRendering.Table.RenderingElementCollection..ctor(RenderingElementContainer owner) +217
   Telerik.Reporting.RtfRendering.Table.RenderingElementContainer..ctor(ProcessingElement processingElement) +73
   Telerik.Reporting.RtfRendering.Table.ReportSection..ctor(ReportSection processingSection) +89
   Telerik.Reporting.RtfRendering.Table.RenderingElementFactory.CreateItem(LayoutElement processingElement) +368
   Telerik.Reporting.RtfRendering.Table.RenderingElementCollection..ctor(RenderingElementContainer owner) +217
   Telerik.Reporting.RtfRendering.Table.RenderingElementContainer..ctor(ProcessingElement processingElement) +73
   Telerik.Reporting.RtfRendering.Table.RenderingElementProxy..ctor(ProcessingElement processingElement) +41
   Telerik.Reporting.RtfRendering.Table.Group..ctor(Group processingGroup) +37
   Telerik.Reporting.RtfRendering.Table.RenderingElementFactory.CreateItem(LayoutElement processingElement) +272
   Telerik.Reporting.RtfRendering.Table.RenderingElementCollection..ctor(RenderingElementContainer owner) +217
   Telerik.Reporting.RtfRendering.Table.RenderingElementContainer..ctor(ProcessingElement processingElement) +73
   Telerik.Reporting.RtfRendering.Table.Report..ctor(Report processingReport) +37
   Telerik.Reporting.RtfRendering.Table.Report..ctor(Report processingReport, Hashtable deviceInfo) +42
   Telerik.Reporting.RtfRendering.Table.RtfTableReport.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +129
   Telerik.Reporting.RtfRendering.RtfReport.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +202
   Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback) +1407
   Telerik.Reporting.Processing.ReportProcessor.RenderCore(String format, IList`1 reports, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback) +103
   Telerik.ReportViewer.WebForms.ReportExportOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback) +194
   Telerik.ReportViewer.WebForms.ReportExportOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, Hashtable renderingContext) +207
   Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride() +316
   Telerik.ReportViewer.WebForms.HandlerOperation.PerformOperation(HttpContext context, ICacheManager cacheManager) +74
   Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context) +241
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +308
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17626 

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 04 Sep 2012, 03:06 PM
Hello Gordon,

The problem is with a Table item in your report, but we cannot say what exactly is the problem without looking at your report. What you can try first is change the rendering mode of the RTF rendering extension via the RenderingMode device setting. For more info how to do that refer to:
On a side note, since Q1 2011 we support export formats based on Office Open XML standards available in Microsoft Office 2007 and above, so try exporting to the new DOCX format and see if that works correctly. If so, you can permanently hide the RTF as shown in the Limit export options in ReportViewer to certain format only KB article. If your users have older MS Office versions which do no open DOCX by default, you can ask them to install the Microsoft Office Compatibility Pack for Word which is provided for free from Microsoft and explain them the benefits of using a newer/better format.

If the above suggestions do not help, please open a support ticket and provide us with the problematic report (runnable so we can get the error) and we would advise you what the problem is after we review it.

All the best,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Gordon Buxton
Top achievements
Rank 1
answered on 04 Sep 2012, 04:06 PM
If it's a table in my report why do other export formats work? Excel 97-2003 works, as does PDF.

I'm using reporting version 6.1.12.611 which I think is Q2-2012,  but I don't see any option to export as Office Open XML.

The options in the dropdown are as follows:

Acrobat (PDF) file
CSV (comma delimited)
Excel 97-2003
TIFF file
Web Archive
XPS Document

- do I need to turn other extensions on somehow? The documentation is extremely limited as to what options I can turn on and off - I tried turning on "DOCX" by putting in a configsection like this:

    <Telerik.Reporting>

        <Extensions>

            <Render>

                <Extension name="RTF" visible="false">

                </Extension>

                <Extension name="DOCX" visible="true">

                </Extension>

            </Render>

        </Extensions>

    </Telerik.Reporting>


But it just crashed the entire report:

Server Error in '/' Application.
A null or zero length string does not represent a valid Type.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


Exception Details: System.TypeLoadException: A null or zero length string does not represent a valid Type.


Source Error:


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:




[TypeLoadException: A null or zero length string does not represent a valid Type.]
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +10749521
   System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +39
   System.Type.GetType(String typeName, Boolean throwOnError) +59
   Telerik.Reporting.Processing.ExtensionManagerBase.CreateExtensionInfo(String typeName, String extensionName) +76


[ExtensionManagerException: Error loading extension type with name .]
   Telerik.Reporting.Processing.ExtensionManagerBase.CreateExtensionInfo(String typeName, String extensionName) +142
   Telerik.Reporting.Processing.ExtensionManagerBase.Config(ExtensionInfoCollection extensions, ReportingConfigurationSection section) +379
   Telerik.Reporting.Processing.ExtensionManagerBase..ctor(IEnumerable`1 extensionTypeNames, ReportingConfigurationSection section) +140
   Telerik.Reporting.Processing.ExtensionManager..ctor(IEnumerable`1 extensionTypeNames, ReportingConfigurationSection reportingSection) +40
   Telerik.Reporting.Processing.ExtensionManager.get_Instance() +100
   Telerik.Reporting.Processing.ExtensionManager.ListExtensions(Type extensionType) +39
   Telerik.Reporting.Processing.ReportProcessor.ListRenderingExtensions() +65
   Telerik.Reporting.Processing.ReportProcessor.GetExtensionInfoCore(String name) +60
   Telerik.Reporting.Processing.ReportProcessor.GetExtensionInfo(String format) +122
   Telerik.Reporting.Processing.ReportProcessor.RenderCore(String format, IList`1 reports, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback) +50
   Telerik.ReportViewer.WebForms.ReportRenderOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback) +46
   Telerik.ReportViewer.WebForms.ReportPageOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, Hashtable renderingContext) +244
   Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride() +316
   Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperationOverride() +173
   Telerik.ReportViewer.WebForms.HandlerOperation.PerformOperation(HttpContext context, ICacheManager cacheManager) +74
   Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context) +241
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +308
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17626 





0
Steve
Telerik team
answered on 05 Sep 2012, 08:34 AM
Hi Gordon,

Every rendering extension has its peculiarities (see Design Considerations for Report Rendering) and they are not supposed to be the same, what might work in one, might be a limitation in another. Of course it could also be a bug in the rendering extension and that is why we asked for a runnable report if the proposed solutions are not feasible for you.

About the export to Word option, 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). When those assemblies are not referenced, it is expected you would get an error when you try to use them in the configuration file. Referencing those assembly is the only requirement to get the export option to the Open XML formats, you do not need to do anything in the configuration file.

Greetings,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Gordon Buxton
Top achievements
Rank 1
Answers by
Steve
Telerik team
Gordon Buxton
Top achievements
Rank 1
Share this question
or