Page 1 of 1

Unable to create PDF report

Posted: Thu Aug 17, 2017 12:55 pm
by vivrai
Hi,

I am trying to generate the PDF report using the below code of lines.

TestReport.SaveReport(); Report.Zip(TestReport.ReportEnvironment,ResultFolderPath+"\\ZipReport","Binding");

Ranorex.PDF.Creator.CreatePDF(ResultFolderPath+"\\ZipReport ,"C:\\Users\\ny102895\\Downloads\\PDFReport", "C:\\Users\\ny102895\\Downloads\\style\\style.xml", "PDFReport");

TestReport.EndTestCase();



I have the required DLL and giving the correct path of Zipped report(.rxzlog) but sill getting error

Exception Occured :System.Exception: Error: *.rxzlog not found.

Is there anyone has solution for this?

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 1:42 pm
by odklizec
Hi,

Are you sure the rxzlog is actually available at given location? Have you checked the path stored in ResultFolderPath? What is the actual report path and rxzlog name?

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 1:53 pm
by vivrai
Yes , I have checked the report path and the Zipped report is available on the path. I tried giving the full path also instead of variable ResultfolderPath but the issue is same.

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 1:58 pm
by odklizec
Are you running Ranorex/your test as administrator? Also, "ZipReport" is the actual report name? I'm not sure CreatePDF does work with filename without extension? Just rename the report to filename.rxzlog and see if that helps?

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 2:05 pm
by vivrai
No , I am not administrator. ZipReport is a folder name ,inside that report is being generated. I tried with .rxzlog extension as well but found the below error.

Exception Occured :System.Exception: Invalid detail
at Ranorex.PDF.ArgumentHandler.handleArgs(String[] args)
at Ranorex.PDF.Program.Main(String[] args)
at Ranorex.PDF.Creator.CreatePDF(String input, String output, String xml, String details)

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 2:16 pm
by odklizec
vivrai wrote:ZipReport is a folder name ,inside that report is being generated.
The first parameter must be path to rxzlog file, including extension!
vivrai wrote:I tried with .rxzlog extension as well but found the below error.

Exception Occured :System.Exception: Invalid detail
at Ranorex.PDF.ArgumentHandler.handleArgs(String[] args)
at Ranorex.PDF.Program.Main(String[] args)
at Ranorex.PDF.Creator.CreatePDF(String input, String output, String xml, String details)
I believe this new error is caused by wrong "Details" parameter. Your used "PDFReport" is unexpected string! It must be either none, failed or all.

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 2:27 pm
by vivrai
I am not understanding "It must be either none, failed or all"?

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 2:33 pm
by odklizec
You must use one of these parameters (none, failed or all), instead of "PDFReport".

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 2:35 pm
by vivrai
i put Details as "all" , now I don't see any error but PDF report didn't get generate.

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 2:43 pm
by odklizec
How big is the rxzlog? As far as I remember, it takes some time to generate PDF from large reports. Also, which version of Ranorex do you use?

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 2:45 pm
by vivrai
Rxlog is just 187 KB. I am using Ranorex version 5.4.1.

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 2:57 pm
by odklizec
vivrai wrote:Rxlog is just 187 KB. I am using Ranorex version 5.4.1.
Are you sure you are using correct libs, code modules and stylesheet for your Ranorex version? They are different for Ranorex 6.2 and lower and 7.0 and higher!
https://www.ranorex.com/blog/ranorex-re ... /#download

BTW, Ranorex 5.4.1 is waaaaay to old and no longer supported, so don't be surprised if the conversion won't work even with correct libs.

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 3:04 pm
by vivrai
Yes , I am using the correct version . Now I see PDF gets generated , it takes some time generate.
Thanks a lot!

Re: Unable to create PDF report

Posted: Thu Aug 17, 2017 3:08 pm
by odklizec
Nice to hear it finally works! I told you, it takes some time to generate report and it's even worse with large reports ;)