Issues with ReportToPDF

Best practices, code snippets for common functionality, examples, and guidelines.
wcrockett
Posts: 17
Joined: Thu Aug 13, 2015 9:30 pm
Location: Fresno, CA

Issues with ReportToPDF

Post by wcrockett » Tue Mar 01, 2016 6:06 pm

Hello all,

I have added the DLL to my project, and set the compile version. Additionally, I have added the ReportToPDF.CS to my project. I have added a tear-down step to an existing test and added the CS module to it. When ran, no PDF is generated and in the tear-down step, no output is given as seen in the CS file.

Is there something more to the ‘installation’ of this package or am I seeing some anomaly of sorts?

For the record, the test I am using this for is 100% user code with no UI interaction… It does still give a report output though.

-Wes

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Issues with ReportToPDF

Post by krstcs » Tue Mar 01, 2016 6:18 pm

I believe you need to add the lines of code that call the PDF writer in the Program.cs file.

The report must be finished before it can be transformed, and it isn't finished if the test suite is still being executed. Therefore, you can't put it in the test suite at all, it must be in Program.cs, after the "TestSuiteRunner.Run(...);" call as the report is finalized at the end of the Run method, right before it returns to Main.
Shortcuts usually aren't...

wcrockett
Posts: 17
Joined: Thu Aug 13, 2015 9:30 pm
Location: Fresno, CA

Re: Issues with ReportToPDF

Post by wcrockett » Tue Mar 01, 2016 7:25 pm

krstcs wrote:I believe you need to add the lines of code that call the PDF writer in the Program.cs file.

The report must be finished before it can be transformed, and it isn't finished if the test suite is still being executed. Therefore, you can't put it in the test suite at all, it must be in Program.cs, after the "TestSuiteRunner.Run(...);" call as the report is finalized at the end of the Run method, right before it returns to Main.
I suppose this makes sense in terms of where code belongs, but it really doesn't line up with the main walk through on doing this. (http://www.ranorex.com/blog/ranorex-rep ... conversion)

The code that I see, which comes in the comments, is the following:

Code: Select all

public static void Ranorex.PDF.Creator.CreatePDF(string input, string output, string xml, string details)
Whenever I put this in my program.cs, I get compile errors.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Issues with ReportToPDF

Post by krstcs » Thu Mar 03, 2016 2:27 pm

Can you include the error? It's a little hard to know what's going on without it.
Shortcuts usually aren't...

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

Re: Issues with ReportToPDF

Post by Support Team » Fri Mar 04, 2016 8:12 am

Hello,

I'm already in conact with Wes, we will update the post as soon as we find a solution. :)

Sincerely,
Robert
.
Image