Report as pdf

Class library usage, coding and language questions.
John
Posts: 2
Joined: Tue Jul 14, 2009 12:51 pm

Report as pdf

Post by John » Mon Feb 08, 2010 4:51 pm

Hi,

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

John

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Report as pdf

Post by Ciege » Mon Feb 08, 2010 6: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: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Report as pdf

Post by Ciege » Mon Feb 08, 2010 7:25 pm

Here is a great link you should read...
http://www.xml-training-guide.com/xml-p ... rsion.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...

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

Re: Report as pdf

Post by John » Tue Feb 09, 2010 10: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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Report as pdf

Post by Support Team » Tue Feb 09, 2010 11:18 am

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

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Report as pdf

Post by Ciege » Tue Feb 09, 2010 4: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...

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Report as pdf

Post by atom » Fri Feb 26, 2010 3: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.

aho
Posts: 1
Joined: Tue Oct 13, 2009 1:13 pm

Re: Report as pdf

Post by aho » Tue Mar 08, 2011 12:43 pm

Does anyone have a XSL-FO stylesheet that replaces the ranorex stylesheet?

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Report as pdf

Post by slavikf » Fri Mar 11, 2011 1:44 am

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.
You do not have the required permissions to view the files attached to this post.

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Report as pdf

Post by slavikf » Fri Mar 11, 2011 3:05 am

Also, same issue when using Ranorex FILE - PRINT function - all style details are lost!

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Report as pdf

Post by atom » Fri Mar 11, 2011 10:40 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Report as pdf

Post by Support Team » Fri Mar 11, 2011 11:09 am

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
You do not have the required permissions to view the files attached to this post.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Report as pdf

Post by Ciege » Fri Mar 11, 2011 5:22 pm

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
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
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Report as pdf

Post by Support Team » Fri Mar 11, 2011 10:49 pm

You might want to try pandoc.
It converts between many formats.

Regards,
Roland
Ranorex Support Team

sop
Posts: 11
Joined: Mon Mar 18, 2013 7:29 am

Re: Report as pdf

Post by sop » Thu May 02, 2013 10:35 am

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