gpt4 book ai didi

eclipse - BIRT - .rptdesign 有错误且无法运行

转载 作者:行者123 更新时间:2023-12-02 22:19:29 28 4
gpt4 key购买 nike

我成功设置了 BIRT Viewer 和 PHP/Java Bridge,我可以查看/打开从 this sample package 获得的“testWebReport.rptdesign”报告像这样通过他们两个:

BIRT 查看器:

http://192.168.0.90:8080/birt/run?__report=report/testWebReport.rptdesign

PHP/Java 桥: Source/tutorial

<?php

define ("JAVA_HOSTS", "192.168.0.90: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{

$report = $birtReportEngine->openReportDesign("${here}/payment.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;

?>

现在,我在 BIRT for Eclipse 中创建一个新报告,然后尝试通过两种方法运行它,但只有第一种方法有效。对于第二个,我收到此消息:

[[o:Exception]:"java.lang.Exception: Invoke failed: [[o:ReportEngine]]->openReportDesign((o:String)[o:String]). Cause: org.eclipse.birt.report.engine.api.EngineException: The design file file:/C:/Program%20Files%20(x86)/EasyPHP-5.3.9/www/BirtBridgeTest/payment.rptdesign has error and can not be run. VM: 1.7.0_04@http://java.oracle.com/" at: #-14 org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.getReportDesignHandle(ReportEngineHelper.java:260) #-13 org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:274) #-12 org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:196) #-11 org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:130) #-10 org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:304) #-9 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) #-8 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) #-6 java.lang.reflect.Method.invoke(Method.java:601) #-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1044) #-4 php.java.bridge.Request.handleRequest(Request.java:417) #-3 php.java.bridge.Request.handleRequests(Request.java:500) #-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:145) #-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60) #0 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\java\Java.inc(232): java_ThrowExceptionProxyFactory->getProxy(6, '@V', 'T', true) #1 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\java\Java.inc(360): java_Arg->getResult(true) #2 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\java\Java.inc(366): java_Client->getWrappedResult(true) #3 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\java\Java.inc(560): java_Client->getResult() #4 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\java\Java.inc(1752): java_Client->invokeMethod(4, 'openReportDesig...', Array) #5 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\java\Java.inc(1851): java_JavaProxy->__call('openReportDesig...', Array) #6 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\java\Java.inc(1999): java_AbstractJava->_call('openReportDesig...', Array) #7 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\HTMLOutput.php(20): Java->_call('openReportDesig...', Array) #8 C:\Program Files (x86)\EasyPHP-5.3.9\www\BirtBridgeTest\HTMLOutput.php(20): java_InternalJava->openReportDesign('C:\Program File...') #9 {main}]

我已经发现导致问题的不是报告的内容,因为无论我创建一个连接到数据库并显示一些图表的报告还是创建一个空白报告都没有关系 -结果是一样的。

有人有办法解决这个问题吗?这几天确实阻碍了我工作的任何进展。

最佳答案

我最终通过在 Eclipse“XML Source”选项卡中编辑以下行解决了这个问题:

<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">

我所要做的就是将版本从 3.2.23 更改为 3.2.2。您可以通过直接在记事本中编辑 .rptdesign 文件来做到这一点。

关于eclipse - BIRT - .rptdesign 有错误且无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11032206/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com