Report as pdf : Automation API

Report as pdf

Class library usage, coding and language questions.

Report as pdf

Postby John » Mon Feb 08, 2010 5:51 pm

Hi,

Has sombody developed a parser in order to transform a Ranorex report (rxlog) to the pdf format?

John
John
 
Posts: 2
Joined: Tue Jul 14, 2009 1:51 pm

Re: Report as pdf

Postby Ciege » Mon Feb 08, 2010 7:36 pm

Since the log is just an XML (you did know that you can rename the log to .xml and it will display in your web browser didn't you?) you can look for a commercial or shareware version of a tool that converts XML to PDF.

Not sure how reliable those tools are since I have never used one but at first glance Google shows quite a few out there.

Since the logs are just XML I stick with that since everyone can just point their browser to the XML log file and be able to see results.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 454
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Report as pdf

Postby Ciege » Mon Feb 08, 2010 8:25 pm

Here is a great link you should read...
http://www.xml-training-guide.com/xml-pdf-conversion.html
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 454
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Report as pdf

Postby John » Tue Feb 09, 2010 11:02 am

Thank you for your answer Ciege,

I don't want to put too much effort in implementing this functionality. I was wondering if Ranorex comes with a functionality to transform the Ranorex report into an open and readable format. Does the Ranorex Report Viewer has some process arguments in order to do this transformation?

The background of my question: I want to attach the report as a file to a test case in my test management system. I don't want to force other users to use Ranorex Viewer in order to analyze the results.

John
John
 
Posts: 2
Joined: Tue Jul 14, 2009 1:51 pm

Re: Report as pdf

Postby Support Team » Tue Feb 09, 2010 12:18 pm

John,
You can use any XSLT tool to transform the Ranorex rxlog file (which is in XML so it is quite open)
into HTML and print it. Or use a virtual PDF printer like FreePDF to print directly to pdf from Ranorex Report Viewer.

Anyway, the rxlog file can be opened in Internet Explorer by renaming it to .xml, just make sure the XSL stylesheet is in the same directory.

If you want to use your own stylesheet, have a look at this:

http://www.ranorex.com/support/user-guide-20/reporting-logging.html#c2682

Michael
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 2006
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Report as pdf

Postby Ciege » Tue Feb 09, 2010 5:08 pm

What I do at the beginning of each of my scripts is crete the log file myself with a .XML extension so I do not need to go and manually rename it everytime. This way the log is quite portable and viewable to anyone with a web browser. After a completed test I move my log file(s) to a networked share so anyone can access them.
You can do similar with this code...

Code: Select all
string LogFile = @"c:\temp\Report\" + strDateTimeStamp + @"\My Log File.xml";
if (Directory.Exists(@"c:\temp\Report\" + strDateTimeStamp) == false)
  {
    Directory.CreateDirectory(@"c:\temp\Report\" + strDateTimeStamp);
  }

Report.Setup(ReportLevel.Debug, LogFile, true);
Report.SystemSummary();
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 454
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Report as pdf

Postby atom » Fri Feb 26, 2010 4:03 pm

To turn XML to PDF, use a tool called FOP from Apache
You will need an XSL-FO stylesheet too

[update]
Just to expand what FOP tool does, its a .exe that you can call from your test case
You can pass it the ranorex xml log file, together with your XSL-FO stylesheet, which contains your formatting information. FOP.exe will then output a PDF file.
atom
 
Posts: 265
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests