Page 1 of 3

Report as pdf

Posted: Mon Feb 08, 2010 4:51 pm
by John
Hi,

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

John

Re: Report as pdf

Posted: Mon Feb 08, 2010 6:36 pm
by Ciege
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.

Re: Report as pdf

Posted: Mon Feb 08, 2010 7:25 pm
by Ciege
Here is a great link you should read...
http://www.xml-training-guide.com/xml-p ... rsion.html

Re: Report as pdf

Posted: Tue Feb 09, 2010 10:02 am
by John
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

Re: Report as pdf

Posted: Tue Feb 09, 2010 11:18 am
by Support Team
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-gui ... html#c2682

Michael
Ranorex Team

Re: Report as pdf

Posted: Tue Feb 09, 2010 4:08 pm
by Ciege
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();

Re: Report as pdf

Posted: Fri Feb 26, 2010 3:03 pm
by atom
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.

Re: Report as pdf

Posted: Tue Mar 08, 2011 12:43 pm
by aho
Does anyone have a XSL-FO stylesheet that replaces the ranorex stylesheet?

Re: Report as pdf

Posted: Fri Mar 11, 2011 1:44 am
by slavikf
I tried FreePDF and CutePDF to convert XML reports to PDF.
Not good :-(
After conversion report looks totally different - color info disappears.
See screenshots:
XML report:
xml_report.PNG
PDF report:
pdf_report.PNG
So, does anybody how to save report to PDF without loosing all that style details?
Or, is there any way to save report, as one file and not bunch of files (XML + style + screenshots + thumbnails...)? Frankly, that the main reason, why i wanted to use PDF.

Re: Report as pdf

Posted: Fri Mar 11, 2011 3:05 am
by slavikf
Also, same issue when using Ranorex FILE - PRINT function - all style details are lost!

Re: Report as pdf

Posted: Fri Mar 11, 2011 10:40 am
by atom
Hiya

Sorry didn't get round to writing a XSL-FO stylesheet
Infact we record all results and output files to oracle database
And we wrote a TestAnalyser tool to load these, and present them to the user in a nice DevExpress GUI

To me log files are of no use when you have 100's of tests running
Your not going to open each one to find out if it passed/failed
So storing results in oracle, and having a tool to analyze them was our only option

Cheers

Re: Report as pdf

Posted: Fri Mar 11, 2011 11:09 am
by Support Team
slavikf wrote:Also, same issue when using Ranorex FILE - PRINT function - all style details are lost!
Make sure you have the "Print Background Colors and Images" option set in the Internet Explorer "Page Setup" settings. Then the styles should be printed, too.
Page_Setup.png
Regards,
Alex
Ranorex Team

Re: Report as pdf

Posted: Fri Mar 11, 2011 5:22 pm
by Ciege
slavikf wrote:So, does anybody how to save report to PDF without loosing all that style details?
Or, is there any way to save report, as one file and not bunch of files (XML + style + screenshots + thumbnails...)? Frankly, that the main reason, why i wanted to use PDF.
Not sure if this is exactly what you want or not, but you can check out the report dashboard I wrote and am sharing with the community. Basically you point it to the root path of where your reports are stored (network drive) and it will interrogate the reports and present a red/yellow/green light for each test report.

Post #2 in this thread has the link to the ZIP. http://www.ranorex.com/forum/post5368.html#p5368

Re: Report as pdf

Posted: Fri Mar 11, 2011 10:49 pm
by Support Team
You might want to try pandoc.
It converts between many formats.

Regards,
Roland
Ranorex Support Team

Re: Report as pdf

Posted: Thu May 02, 2013 10:35 am
by sop
hi Ciege
I was looking for the same thing and found this thread
Ciege wrote: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?) ...

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.

I did that but teh file can not be open
the error message in Chrome is
error on line 11 at column 124: xmlParseEntityRef: no name

looking at that line I see the following

Code: Select all

		(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var 
column 124 is in fact
function J(a,c,d){if(d===b&&a.nodeType===1){

the folder contains RanorexReport4.css and few other files

file can not be opened in explorer either

obviously suggested by you later the wat to produce xml file instead of .rxlog from the source code has the same problem

could you suggest why is it?

thanks,
sop