hi all,<br />
<br />
i have a curious problem. i installed birt 2.3 and eclipse and using a php-script with the java-bridge-tool (<a class='bbc_url' href='
http://php-java-bridge.sourceforge.net/pjb/)'>http://php-java-bridge.sourceforge.net/pjb/)</a>. i use no tomcat or other java-server, only apache and the java-brigde included. <br />
with all standards it works fine, export to xls, html and pdf. ok. now i want to report in .csv, therefore i downloaded the script from <a class='bbc_url' href='
http://www.actuate.com/products/products-resources.asp?ArticleId=11719'>Actuate BIRT Community Contributions</a> and i gone this instructions <a class='bbc_url' href='
http://www.birt-exchange.com/blog/2008-10-07/using-the-csv-emitter-with-birt-230/'>Using the CSV emitter with BIRT 2.3.0 » Blog - BIRT Exchange</a> to test it under eclipse. in ecpilse it works, the csv-file are created. <br />
now i will insert this all into my php-script (firstly a demoscript), in which the other reports (xls, html, pdf...) are working fine. so i edit the script and call it from the browser. but, instead a correct file, i get following message:<br />
<br />
Fatal error: Uncaught
o:Exception]:"java.lang.Exception: Invoke failed: [[o:RunAndRenderTask->run. Cause: org.eclipse.birt.report.engine.api.EngineException: Report engine fails to initialize CSV emitter, please make sure required libraries for this emitter are installed. VM: <a href='mailto:' title='E-mail Link' class='bbc_email'>1.6.0_11@
http://java.sun.com</a>/" at: #-12 org.eclipse.birt.report.engine.api.impl.EngineTask.createContentEmitter(EngineTask.java:1186) #-11 org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:94) #-10 org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:72) #0 <a class='bbc_url' href='
http://localhost:8080/JavaBridge/java/Java.inc(265):'>http://localhost:8080/JavaBridge/java/Java.inc(265):</a> java_ThrowExceptionProxyFactory->getProxy(13, '
@V', true) #1 <a class='bbc_url' href='
http://localhost:8080/JavaBridge/java/Java.inc(417):'>http://localhost:8080/JavaBridge/java/Java.inc(417):</a> java_Arg->getResult(true) #2 <a class='bbc_url' href='
http://localhost:8080/JavaBridge/java/Java.inc(423):'>http://localhost:8080/JavaBridge/java/Java.inc(423):</a> java_Client->getWrappedResult(true) #3 <a class='bbc_url' href='
http://localhost:8080/JavaBridge/java/Java.inc(627):'>http://localhost:8080/JavaBridge/java/Java.inc(627):</a> java_Client->getResult() #4 <a class='bbc_url' href='
http://localhost:8080/JavaBridge/java/Java.inc(1753):'>http://localhost:8080/JavaBridge/java/Java.inc(1753):</a> java_Clien in <a class='bbc_url' href='
http://localhost:8080/JavaBridge/java/Java.inc'>http://localhost:8080/JavaBridge/java/Java.inc</a> on line 228<br />
<br />
not so good. but i don't know the problem. the file "org.eclipse.birt.report.engine.emitter.csv_1.0.0.jar" are correct in the "ReportEngineplugins"-dir, and i call it. so, what other libraries?<br />
<br />
my php-script (so, not very difficult):<br />
<br />
// Initialize instance<br />
include_once("
http://localhost:8080/JavaBridge/java/Java.inc");<br />
// Set URL of java bridge include file<br />
$serverUrl = "
http://localhost:8080/JavaBridge/java/Java.inc";<br />
<br />
$arrIncludedFiles = get_included_files();<br />
$includedFilename = basename($serverUrl);<br />
<br />
$isConnected = false;<br />
for($i=0, $m=sizeof($arrIncludedFiles); $i<$m; $i++) <br />
{<br />
if(basename($arrIncludedFiles[$i]) == $includedFilename) <br />
{<br />
$isConnected = true;<br />
}<br />
}<br />
<br />
if($isConnected == false)<br />
{<br />
echo "!!> Could not connect to ".self::getServerUrl()."<br />
";<br />
}<br />
<br />
// Set encoding to UTF-8, very important!<br />
java_set_file_encoding("UTF-8");<br />
<br />
$aDir = "C:/xampp/php/ext/ReportEngine/lib";<br />
$hDir = opendir($aDir);<br />
<br />
$tRequired = "";<br />
if($hDir != false) <br />
{<br />
while(false !== ($hFile = readdir($hDir))) <br />
{<br />
if(preg_match("/(.*).jar/", $hFile)) <br />
{<br />
$tRequired .= ";$aDir/$hFile";<br />
}<br />
}<br />
java_require($tRequired);<br />
}<br />
java_require("C:/xampp/php/ext/ReportEngine/plugins/org.eclipse.birt.report.engine.emitter.csv_1.0.0.jar"); <br />
<br />
$engineHome = "C:/xampp/php/ext/ReportEngine";<br />
$engineConfig = new Java("org.eclipse.birt.report.engine.api.EngineConfig");<br />
$engineConfig->setEngineHome($engineHome);<br />
$platform = new Java("org.eclipse.birt.core.framework.Platform");<br />
$platform->startup($engineConfig);<br />
$renderOptionBase = new Java("org.eclipse.birt.report.engine.emitter.csv.CSVRenderOption");<br />
$renderOptionBase->setOutputFormat("CSV");<br />
$renderContext = new Java("org.eclipse.birt.report.engine.api.DOCRenderContext");<br />
$reportFolderPath = "C:/xampp/php/ext/ReportEngine/samples";<br />
$renderContext->setBaseUrl($reportFolderPath);<br />
$reportPath = "C:/xampp/htdocs/demoreport.rptdesign";<br />
$aOutputFileName = "C:/xampp/htdocs/report.csv";<br />
$renderOptionBase->setOutputFileName($aOutputFileName);<br />
$myContext = array();<br />
$engineConstants = new Java("org.eclipse.birt.report.engine.api.IReportEngineFactory");<br />
$myContext["".$engineConstants->EXTENSION_REPORT_ENGINE_FACTORY] = $renderContext;<br />
$contextMap = $myContext;<br />
<br />
$reportEngineFactoryObj = new Java("org.eclipse.birt.report.engine.api.IReportEngineFactory");<br />
$reportEngineFactory = $platform->createFactoryObject($reportEngineFactoryObj->EXTENSION_REPORT_ENGINE_FACTORY);<br />
$reportEngine = $reportEngineFactory->createReportEngine($engineConfig);<br />
<br />
$reportDesign = $reportEngine->openReportDesign($reportPath);<br />
$renderTask = $reportEngine->createRunAndRenderTask($reportDesign); <br />
$renderTask->setAppContext($contextMap);<br />
$renderTask->setRenderOption($renderOptionBase);<br />
$renderTask->run();<br />
$renderTask->close();<br />
$reportEngine->destroy();<br />
@java_reset();<br />
<br />
<br />
somebody has a solution?