ReportToPDF is throwing object reference not set error

Ask general questions here.
simmisj
Posts: 19
Joined: Tue Feb 27, 2018 10:12 am

ReportToPDF is throwing object reference not set error

Post by simmisj » Fri Apr 13, 2018 2:02 pm

Hi.
I working with generating pdf reports and it was working using the automation helpers but suddenly it writes a red line stating that an Object reference is not set.
RanorexPdfGeneratorHanging.PNG
RanorexPdfGeneratorHanging.PNG (7.62 KiB) Viewed 231 times
It happens in line 121 in the default ReportToPDFModule.cs. This line:
Ranorex.PDF.Creator.CreatePDF(input, PDFReportFilePath, xml, details);

Stacktrace:
RanorexPdfReportStackTrace.PNG
RanorexPdfReportStackTrace.PNG (34.73 KiB) Viewed 227 times
Suddenly this starts to happen. Any clue as to what is going on?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: ReportToPDF is throwing object reference not set error

Post by Support Team » Fri Apr 13, 2018 6:07 pm

Hi Simmisj,

Based on the provided exception, it appears you are not running any test cases when testing the ReportToPDF module since it is failing to convert the pie chart in the report. The pie chart only exists when one or more test cases are executed. If you are only executing setup and teardown regions, no pie chart is generated and you will see this error.

We thank you for reporting this issue and I have since contacted the developer of this tool requesting improved error handling in this scenario. I hope this helps!

Cheers,
Ned
.
Image

simmisj
Posts: 19
Joined: Tue Feb 27, 2018 10:12 am

Re: ReportToPDF is throwing object reference not set error

Post by simmisj » Mon Apr 16, 2018 9:53 am

Absolutely right.
The reason I was not running any test cases was so that I could explore the ReportToPDF without waiting for test cases to finish. Now I have just created an empty test case that I run and that fixes the issue.

Thanks.