In iReport Designer options, the path to PDF Viewer is set to be "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" (without quotes). But when I run any report with PDF Preview enabled, I get following error;
Executing: C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe "Y:\BikramShrestha\Jasper 3.7.0\Rpt1515D.pdf"
Error viewing report...
java.io.IOException: Cannot run program "C:\Program": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:1240)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.
at java.lang.ProcessImpl.start(Unknown Source)
... 7 more
It seems like the path given for Adobe Acrobat Reader gets truncated after the space character. However, the internal preview for pdf works from within the iReport designer. Has anyone encountered similar problem? Any suggestions?
4 Answers:
I found the work around by adding the path to AcroRd32.exe in Windows environment variable and in iReport Designer options, the path to PDF Viewer just set to "AcroRd32.exe" (without quotes).
To add to the environment variable follow these steps;
- Right click on computer and go to properties.
- Click on "Advanced system settings" option.
-Click on "Environment Variables" button.
-In the "System variables" look for Variable named "Path". Edit it and add "C:\Program Files (x86)\Adobe\Reader 11.0\Reader" at the end.
-Click on OK.
- You may need to restart the computer and iReport application both for the change to get working.
As for me, I am using another PDF viewer instead of Adobe Acrobat Reader. What's more, using code to deal with the related PDF viewing problem is too complicated for me. I prefer to do it with the help of some manual toolkits which can be customized by users according to our own favors. You can also google it and select one whose way of processing is simple and fast to help you with the related work. Remember to check its free trial package first if possible. I hope you success. Good luck.
Best regards,
Arron