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: 902
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: 902
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: 4267
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: 902
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: 321
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: Report as pdf

Postby aho » Tue Mar 08, 2011 1:43 pm

Does anyone have a XSL-FO stylesheet that replaces the ranorex stylesheet?
aho
 
Posts: 1
Joined: Tue Oct 13, 2009 2:13 pm

Re: Report as pdf

Postby slavikf » Fri Mar 11, 2011 2: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
xml_report.PNG (19.66 KiB) Viewed 396 times

PDF report:
pdf_report.PNG
pdf_report.PNG (36.18 KiB) Viewed 396 times


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.
User avatar
slavikf
 
Posts: 94
Joined: Mon Sep 13, 2010 10:07 pm
Location: Sacramento, CA

Re: Report as pdf

Postby slavikf » Fri Mar 11, 2011 4:05 am

Also, same issue when using Ranorex FILE - PRINT function - all style details are lost!
User avatar
slavikf
 
Posts: 94
Joined: Mon Sep 13, 2010 10:07 pm
Location: Sacramento, CA

Re: Report as pdf

Postby atom » Fri Mar 11, 2011 11: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
atom
 
Posts: 321
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: Report as pdf

Postby Support Team » Fri Mar 11, 2011 12:09 pm

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
Internet Explorer Page Setup
Page_Setup.png (47.65 KiB) Viewed 378 times

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

Re: Report as pdf

Postby Ciege » Fri Mar 11, 2011 6: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
Ciege
 
Posts: 902
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Report as pdf

Postby Support Team » Fri Mar 11, 2011 11:49 pm

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

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


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests

cron