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

Adding dynamic table causes Object not found error

1 Answer 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Glenn
Top achievements
Rank 1
Glenn asked on 03 Feb 2014, 07:51 PM
Hi all,

Version: Q3 2013.

I have created a report in the designer, added some basic elements.  I created a class to create a Telerik.Reporting.Table.  I then add the table to the report's detail section.  All is looking good at this point.  All I can think of is I missed something some where.

myReport.Items["detailSection"].Items.Clear();

                Telerik.Reporting.Table subTable = myReportBuilder.GetTable();
subTable.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(subReportDefaultLocation)
, Telerik.Reporting.Drawing.Unit.Inch(currentLocation));

myReport.Items["detailSection"].Items.Add(subTable);

Telerik.Reporting.InstanceReportSource rptSource = new Telerik.Reporting.InstanceReportSource { ReportDocument = myReport };

reportViewer1.ReportSource = rptSource;

reportViewer1.RefreshReport();

In the reportviewer I get the Object reference not set to an instance of an object.

What I'm asking is:
a) How do I locate the offending piece and what changes do I need based on the information noted below
b) what does the output mean

My company will not authorize me to post the actual class, but can submit directly to Telerik support.

<Output>
The thread '<Thread Ended>' (0x33a0) has exited with code 0 (0x0).
Step into: Stepping over method without symbols 'Telerik.Reporting.InstanceReportSource.InstanceReportSource'
Step into: Stepping over method without symbols 'Telerik.Reporting.InstanceReportSource.ReportDocument.set'
Step into: Stepping over method without symbols 'Telerik.ReportViewer.WinForms.ReportViewerBase.ReportSource.set'
Step into: Stepping over method without symbols 'Telerik.ReportViewer.WinForms.ReportViewerBase.RefreshReport'
'ReportsTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'
Step into: Stepping over method without symbols 'System.Windows.Forms.Form.OnLoad'
Step into: Stepping over method without symbols 'System.Windows.Forms.Control.CreateControl'
Step into: Stepping over method without symbols 'System.Windows.Forms.Control.CreateControl'
Step into: Stepping over method without symbols 'System.Windows.Forms.Control.WmShowWindow'

Step into: Stepping over method without symbols 'System.Windows.Forms.Control.WndProc'
*** ReportProcessor.ProcessReport STARTED ***
Step into: Stepping over method without symbols 'System.Windows.Forms.Form.WndProc'
Step into: Stepping over method without symbols 'System.Windows.Forms.NativeWindow.DebuggableCallback'

*** ProcessReport #0 STARTED ***
Step into: Stepping over method without symbols 'System.Windows.Forms.Control.SetVisibleCore'
Step into: Stepping over method without symbols 'System.Windows.Forms.Form.SetVisibleCore'
Step into: Stepping over method without symbols 'System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner'

*** Report Processing STARTED ***

*** Table::ProcessItem STARTED ***

*** TableBuilder::AddColumns STARTED ***
*** TableBuilder::AddColumns DONE in 00:00:00.0075209 ***


*** TableBuilder::AddRows STARTED ***
*** TableBuilder::AddRows DONE in 00:00:00.0022374 ***


*** TableBuilder::AddBody STARTED ***
*** TableBuilder::AddBody DONE in 00:00:00.0043412 ***

*** Table::ProcessItem DONE in 00:00:00.0370327 ***

*** Report Processing DONE in 00:00:00.1095166 ***

*** ProcessReport #0 DONE in 00:00:00.1425153 ***

*** ReportProcessor.ProcessReport DONE in 00:00:00.1537056 ***


*** Get IMAGEInteractive Rendering Extension STARTED ***
'ReportsTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Telerik.Reporting.XpsRendering\v4.0_7.2.13.1016__a9d7983dfcc261be\Telerik.Reporting.XpsRendering.dll'
'ReportsTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Telerik.Reporting.OpenXmlRendering\v4.0_7.2.13.1016__a9d7983dfcc261be\Telerik.Reporting.OpenXmlRendering.dll'
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'Telerik.Reporting.Interfaces.ExtensionManagerException' occurred in Telerik.Reporting.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'Telerik.Reporting.Interfaces.ExtensionManagerException' occurred in Telerik.Reporting.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'Telerik.Reporting.Interfaces.ExtensionManagerException' occurred in Telerik.Reporting.dll
*** Get IMAGEInteractive Rendering Extension DONE in 00:00:00.0764216 ***


*** Measure Report STARTED ***

*** Measure Report STARTED ***

*** Measure Report STARTED ***
A first chance exception of type 'System.NullReferenceException' occurred in Telerik.Reporting.dll
*** Measure Report DONE in 00:00:00.0162011 ***

*** Measure Report DONE in 00:00:00.0190725 ***

*** Measure Report DONE in 00:00:00.0211237 ***

An error has occurred while rendering the report: System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Reporting.Processing.Table.ForEachCell(Action`1 action)
at Telerik.Reporting.Processing.Table.MeasureDataItemContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.DataItem.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureChildItems(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.ReportSectionBase.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.Group.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.Report.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureElement(LayoutElement elementToMeasure, IMeasureContext context)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.MeasureReportCore(Report report, IMeasureContext measureContext)
at Telerik.Reporting.ImageRendering.ImageReportInteractive.MeasureReportCore(Report report, IMeasureContext measureContext)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.MeasureReport(Report report)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
A first chance exception of type 'System.NullReferenceException' occurred in Telerik.Reporting.dll
The thread 'Rendering' (0x40dc) has exited with code 0 (0x0).
Object reference not set to an instance of an object.
at Telerik.Reporting.Processing.Table.ForEachCell(Action`1 action)
at Telerik.Reporting.Processing.Table.MeasureDataItemContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.DataItem.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureChildItems(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.ReportSectionBase.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.Group.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.Report.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureElement(LayoutElement elementToMeasure, IMeasureContext context)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.MeasureReportCore(Report report, IMeasureContext measureContext)
at Telerik.Reporting.ImageRendering.ImageReportInteractive.MeasureReportCore(Report report, IMeasureContext measureContext)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.MeasureReport(Report report)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
at Telerik.Reporting.Processing.ReportProcessor.CountPages(IList`1 reports, IRenderingContext renderingContext, Hashtable deviceInfo, ExtensionInfo extensionInfo, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderCore(String format, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.ReportViewer.Common.ReportRenderer.Render(ReportRendererArgs args)
WinViewer> An error has occurred while rendering a report:
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Reporting.Processing.Table.ForEachCell(Action`1 action)
at Telerik.Reporting.Processing.Table.MeasureDataItemContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.DataItem.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureChildItems(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.ReportSectionBase.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.Group.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.Report.MeasureContent(IMeasureContext context, SizeRF availableClientSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.Measure(IMeasureContext context, SizeRF availableSize)
at Telerik.Reporting.Processing.LayoutElement.MeasureElement(LayoutElement elementToMeasure, IMeasureContext context)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.MeasureReportCore(Report report, IMeasureContext measureContext)
at Telerik.Reporting.ImageRendering.ImageReportInteractive.MeasureReportCore(Report report, IMeasureContext measureContext)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.MeasureReport(Report report)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
at Telerik.Reporting.Processing.ReportProcessor.CountPages(IList`1 reports, IRenderingContext renderingContext, Hashtable deviceInfo, ExtensionInfo extensionInfo, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderCore(String format, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.ReportViewer.Common.ReportRenderer.Render(ReportRendererArgs args)
Step into: Stepping over method without symbols 'System.Windows.Forms.Application.ThreadContext.RunMessageLoop'
</Output>

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 06 Feb 2014, 05:15 PM
Hello Glenn,

Since the major part of the code you are using to create the table is not shown here, we are unable to determine the exact reason for the described issue.

Thus, it would be best if you open a support ticket, where you can zip and attach a sample report definition exhibiting the described issue. Once we review it, we would be able to provide you with more information.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Tags
General Discussions
Asked by
Glenn
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or