Report with external subreports throws "Object reference no"

Stimulsoft Reports.WEB discussion
Post Reply
adinac
Posts: 16
Joined: Mon Apr 22, 2013 11:59 am

Report with external subreports throws "Object reference no"

Post by adinac »

Hello,

I have a main report with multiple external subreports. Both the main report and the subreports receives a parameter as input. I am using it to export the report to pdf, but for some values (the same values) of the input parameter, I get the following error "Object reference not set to an instance of an object." at the line "mainReport.Render(true);".

If I try to export the subreports for those values, the report is exported successfully.

The full error is below. Any feedback is helpful.

Thanks,

Adina

Code: Select all

[NullReferenceException: Object reference not set to an instance of an object.]
   Stimulsoft.Report.Components.StiContainer.Break(StiComponent dividedComponent, Double devideFactor, Double& divideLine) +729
   Stimulsoft.Report.Components.StiComponentDivider.BreakContainer(Double maxAllowedHeight, StiContainer renderedContainer) +1179
   Stimulsoft.Report.Engine.StiBreakableHelper.Break(StiContainer originalContainer) +41
   Stimulsoft.Report.Engine.StiBreakableHelper.ProcessBreakable(StiContainer container) +106
   Stimulsoft.Report.Engine.StiEngine.InternalRenderContainer(StiContainer container, Boolean isPrintAtBottom, Boolean isFooterOnAllPages) +352
   Stimulsoft.Report.Engine.StiEngine.InternalRenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents, Boolean& isChildsEnabled) +1437
   Stimulsoft.Report.Engine.StiEngine.RenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents) +602
   Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderBand(StiDataBand masterDataBand, StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents) +209
   Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderMaster(StiDataBand masterDataBand) +1177
   Stimulsoft.Report.Engine.StiPageHelper.RenderPage(StiPage page) +2291
   Stimulsoft.Report.Engine.StiRenderProviderV2.RenderReport(StiReport report, StiReport masterReport, StiRenderState state) +2514
   Stimulsoft.Report.Engine.StiRenderProviderV2.Render(StiReport report, StiRenderState state) +6233
   Stimulsoft.Report.Engine.StiReportV2Builder.RenderSingleReport(StiReport masterReport, StiRenderState renderState) +1457
   Stimulsoft.Report.StiReport.RenderReport(StiRenderState renderState) +2263
   Stimulsoft.Report.StiReport.Render(StiRenderState renderState, StiGuiMode guiMode) +1056
   ProtrackMonthlyReport.Utils.ReportHelper.ExportReportAsPdf(String reportTemplate, String reportPdf, String appDirectory, DateTime reportDate) in D:\Work\MonthlyReport\Utils\ReportHelper.cs:41
   ProtrackMonthlyReport.frmPreviewReport.GenerateReport(Int32 year, Int32 month, Boolean regenerateDrp) in D:\Work\MonthlyReport\frmPreviewReport.aspx.cs:40
   ProtrackMonthlyReport.frmPreviewReport.GetReportByID(Int32 month) in D:\Work\Protrack\MonthlyReport\frmPreviewReport.aspx.cs:70
   ProtrackMonthlyReport.frmPreviewReport.Page_Load(Object sender, EventArgs e) in D:\Work\MonthlyReport\frmPreviewReport.aspx.cs:20
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: Report with external subreports throws "Object reference

Post by Ivan »

Hello,

Can you please send us a sample report with data or a simple test project, which reproduce the issue?

Thank you.
adinac
Posts: 16
Joined: Mon Apr 22, 2013 11:59 am

Re: Report with external subreports throws "Object reference

Post by adinac »

Hi Ivan

I have created a project which reproduces the behavior. One thing that I was while doing the sample example was that there were no problems while each subreport contained tables with max 5 rows. But once the tables have more data, it started failing.

Adina
Attachments
MonthlyReport.zip
(2.07 MiB) Downloaded 224 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Report with external subreports throws "Object reference

Post by HighAley »

Hello.

We have made an improvement.
Please, try our latest prerelease build that is already available on our site.

Thank you.
adinac
Posts: 16
Joined: Mon Apr 22, 2013 11:59 am

Re: Report with external subreports throws "Object reference

Post by adinac »

Hello,

I have tested with latest version, and it is working indeed.

Thank you very much,

Adina
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Report with external subreports throws "Object reference

Post by Andrew »

Great!

Have a good day!
Thank you.
Post Reply