Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Problem to get data over report-library with php/javabridge
iparker
Hello,
I have a problem to use a report-library in a report over the php/javabridge.
I definied a report-library with the parameter for the db-connection, the data-source (mysql) and two data-sets. In the report I included the library and the named items from the library (parameter, data-set etc.). I insert a simple table which outputs different data from the data-set.
I placed the library on the server at the ?setRessourcePath?.
In the output of the report appears the table without content. It seams that the ?include? of the library is not the problem because of I get no error message.
The strage thing is: If I generate the same data-set from the report-library directly in the report (with another name) and when I insert a second table into the report which binds to the new ?direct-data-set?, suddenly both tables have content!
Could someone explain this to me? How can I use a library with the php/javabridge?
Thanks for some answers!
Timo
Find more posts tagged with
Comments
JasonW
can you post your code that shows how you are setting the resource folder? I assume this is a misspelling: setRessourcePath. Here is an example I used to get libs to work. BTW if the lib is in the same location as the report it should work as well.
<?php
define ("JAVA_HOSTS", "127.0.0.1:8080");
define ("JAVA_SERVLET", "/JavaBridge/JavaBridge.phpjavabridge");
$pth = "
http://"
; . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
$path_parts = pathinfo($pth);
$imageURLPrefix = $path_parts['dirname'] ."/sessionChartImages/";
require_once("java/Java.inc");
session_start();
$here = getcwd();
$ctx = java_context()->getServletContext();
$birtReportEngine = java("org.eclipse.birt.php.birtengine.BirtEngine")->getBirtEngine($ctx);
java_context()->onShutdown(java("org.eclipse.birt.php.birtengine.BirtEngine")->getShutdownHook());
try{
//should only be set once will affect all users of the engine
$birtReportEngine->getConfig()->setResourcePath(${here} . "/birtreportlib" );
$report = $birtReportEngine->openReportDesign("${here}/uselib.rptdesign");
$task = $birtReportEngine->createRunAndRenderTask($report);
$taskOptions = new java("org.eclipse.birt.report.engine.api.HTMLRenderOption");
$outputStream = new java("java.io.ByteArrayOutputStream");
$taskOptions->setOutputStream($outputStream);
$taskOptions->setOutputFormat("html");
$ih = new java( "org.eclipse.birt.report.engine.api.HTMLServerImageHandler");
$taskOptions->setImageHandler($ih);
$taskOptions->setBaseImageURL($imageURLPrefix . session_id());
$taskOptions->setImageDirectory($here . "/sessionChartImages/" . session_id());
$task->setRenderOption( $taskOptions );
$task->run();
$task->close();
} catch (JavaException $e) {
echo $e; //"Error Calling BIRT";
}
echo $outputStream;
?>
Jason