NullReferenceException on report.Render()

Stimulsoft Reports.WEB discussion
Post Reply
faddoul.antoine
Posts: 16
Joined: Mon Sep 24, 2012 7:08 am

NullReferenceException on report.Render()

Post by faddoul.antoine »

Hi.

I am trying to use Stimulsoft to export a data grid to excel in a DotNetNuke module.

I am using Stimulsoft 2011(both designer and dlls).

I created a report using the designer, saved it as .dll and included it in the project reference.

In the button click event, i wrote the following code:

Code: Select all

       Report ReportName = new Report();
                // Fill list of business objects here
                StiBusinessObjectData objStiBusinessObjectData = new StiBusinessObjectData("Category", "Name", Value);
                List<StiBusinessObjectData> objCollections = new List<StiBusinessObjectData>();
                objCollections.Add(objStiBusinessObjectData);
                ReportName.RegBusinessObject(objCollections);
                ReportName.Render(false);
                ReportName.ExportDocument(StiExportFormat.Excel2007, strfilename);
When the code was executed, the following exception was thrown:

System.NullReferenceException was caught
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=Stimulsoft.Report
StackTrace:
at Stimulsoft.Report.StiReport.GetComponents()
at Stimulsoft.Report.StiReport.RenderReport(StiRenderState renderState)
at Stimulsoft.Report.StiReport.Render(StiRenderState renderState, StiGuiMode guiMode)
at Stimulsoft.Report.StiReport.Render(StiRenderState renderState)
at Stimulsoft.Report.StiReport.Render(Boolean showProgress, Int32 fromPage, Int32 toPage)
at Stimulsoft.Report.StiReport.Render(Boolean showProgress)
at .....ExportGridToExcel1(Object sender, EventArgs e) in
InnerException:

I tried using a blank report and without adding any business objects but the exception would not go away.

Any idea what i am doing wrong?

Thank you
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: NullReferenceException on report.Render()

Post by Alex K. »

Hello,

Can you please send us a sample project which reproduce the issue for analysis.

Thank you.
faddoul.antoine
Posts: 16
Joined: Mon Sep 24, 2012 7:08 am

Re: NullReferenceException on report.Render()

Post by faddoul.antoine »

I tried creating a sample project without DotNetNuke but, although the project was identical to the module i created earlier, the exception was not thrown. Could it be related to DotNetNuke? Do i need to add different references for DNN?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: NullReferenceException on report.Render()

Post by Alex K. »

Hello,

We couldn't reproduce this bug on last version.
Please check the latest build and let us know about the result.

Thank you.
faddoul.antoine
Posts: 16
Joined: Mon Sep 24, 2012 7:08 am

Re: NullReferenceException on report.Render()

Post by faddoul.antoine »

I tried using the latest build and i still got the same problem. Did you try it with DNN? I am using it with DNN 06.02.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: NullReferenceException on report.Render()

Post by Alex K. »

Hello,

Can you please send us a simple project which reproduce the issue for analysis.

Thank you.
Post Reply