I'm trying to generate a crystal report via a php script. I was able to successfully use crexport to generate a pdf report. However when I try to execute the script via php's exec command I get this error.
c:\inetpub\wwwroot\mamobile\crexport -F c:\inetpub\wwwroot\mamobileeports\customer.rpt -O c:\inetpub\wwwroot\mamobile\output\test.pdf -E pdf -S testdb
Crystal Reports Exporter Command Line Utility. Version 2.1.11.1103
Copyright(c) 2011 Rainforest Software Solution http://www.rainforestnet.com
Misc Error: Load report failed.
Type "crexport -?" for help
It works fine via the command prompt.
This is unlikely but is your report by any chance still open in the Crystal Designer when you were running this script? I was getting this error when the .rpt file was open.
it works. remember to not be with the open rpt file in graphics editor
$output = '';
$command = 'c:\inetpub\wwwroot\mamobile\crexport -F c:\inetpub\wwwroot\mamobileeports\customer.rpt -O c:\inetpub\wwwroot\mamobile\output\test.pdf -E pdf -S testdb';
exec($command, $output);
var_dump($output);