Image 带IText的Birt图像永远不会结束
我正在处理Birt报告,当我想要生成pdf文件时,它永远不会结束。问题就在眼前。 IRunAndRenderTask.run。我在创建IBirEngine时也不例外。 下面是创建BirtEngine和报告设计的代码Image 带IText的Birt图像永远不会结束,image,report,itext,birt,Image,Report,Itext,Birt,我正在处理Birt报告,当我想要生成pdf文件时,它永远不会结束。问题就在眼前。 IRunAndRenderTask.run。我在创建IBirEngine时也不例外。 下面是创建BirtEngine和报告设计的代码 private static IReportEngine birtEngine = null; private static IReportRunnable examenAuditifReportDesign = null; private static IReportRunnabl
private static IReportEngine birtEngine = null;
private static IReportRunnable examenAuditifReportDesign = null;
private static IReportRunnable bilanCollectifReportDesign = null;
private static Properties configProps = new Properties();
static{
loadEngineProps();//Read the birt configuration properties
EngineConfig config = new EngineConfig();
if( configProps != null){
config.setLogConfig(configProps.getProperty("logDirectory"), Level.INFO);
config.setBIRTHome(configProps.getProperty("birtHome"));
config.setResourcePath(configProps.getProperty("ressourcePath"));
config.setEngineHome(configProps.getProperty("birtHome"));
config.setProperty("birtReportsHome", configProps.getProperty("birtReportsHome"));
}
try {
RegistryProviderFactory.releaseDefault();
Platform.startup( config );
} catch ( BirtException e ) {
e.printStackTrace( );
}
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
birtEngine = factory.createReportEngine( config );
try {
examenAuditifReportDesign = birtEngine.openReportDesign(
new FileInputStream(birtEngine.getConfig().getProperty("birtReportsHome") + "/examenAuditif.rptdesign"));
bilanCollectifReportDesign = birtEngine.openReportDesign(
new FileInputStream(birtEngine.getConfig().getProperty("birtReportsHome") + "/bilanCollectif.rptdesign"));
} catch (EngineException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
下面是执行报告的代码
IRunAndRenderTask task = birtEngine.createRunAndRenderTask(examenAuditifReportDesign);
task.setParameterValue("RPT_ID_Travailleur", t.getId());
task.setParameterValue("RPT_LATEST_HA", params.getId_latest_ha());
task.setParameterValue("RPT_LATEST_EXAMN", params.getId_latest_examen());
task.setParameterValue("RPT_PREVIOUS_HA", params.getId_previous_ha());
task.setParameterValue("RPT_PREVIOUS_EXAMN", params.getId_previous_examen());
PDFRenderOption options = new PDFRenderOption();
options.setOutputStream(outputStream);
options.setOutputFormat("pdf");
task.setRenderOption(options);
task.run();
task.close();
并且在task.run中;我试了大约1个小时或1个半小时,结果没有结束。
如果有人能帮上忙,我将不胜感激
再见,谢谢。如果此报告在birt Eclipse设计器中工作,那么它应该与birt运行时API一起工作,问题在您的代码中 当任务终止时,您需要关闭发送到PDFRenderOption对象的outputStream 将此行添加到代码中: options.setSupportDimageFormatsPNG;JPG;骨形态发生蛋白
我发现了这个问题,它不是两个API中的任何一个 我们试图为worker生成一个pdf文件,我们正在压缩所有worker的所有pdf文件,这个压缩保存在数据库中的一个blob中。这就是问题所在 如果zip文件保存在文件系统中,它可以正常工作
谢谢大家。如果您尝试根据示例数据库生成一份带有简单演示报告的PDF,这是一样的,还是这个问题只针对一份报告?我们现在只需要一份报告,以及设计报告的人员,他在本地机器上用eclipse和我正在使用的同一个数据库测试它,我下载了birt运行时的源代码,并进行了调试。我发现问题出在IText上。我不知道为什么。问题在于图像。在addimage行中,它冻结com.lowagie.text.pdf.PdfTemplate模板;template.addImage图像,宽度,0,0,高度,0,0;也在最后,;com.lowagie.text.Document文档;doc.close;请帮忙。谢谢当我在提到的软件包中看到我的名字时,我知道您使用的是不再受支持的iText版本。看,是的!!。很抱歉,此版本包含在我们正在使用的birt版本中。org.eclipse.birt.runtime.v_4.2.1[很多数字].jar