用于创建Pentaho报告的Java代码,此报告接受输入作为数据集成(.ktr)文件 [英] Java code for creating Pentaho reports and this reports accept input as data integration(.ktr) file

查看:289
本文介绍了用于创建Pentaho报告的Java代码,此报告接受输入作为数据集成(.ktr)文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找Java代码,其中必须将HTML/PDF格式的Pentaho报告与数据集成(.ktr文件)一起显示为Pentaho报告的输入.

I am looking for java code in which have to display Pentaho reports in HTML/PDF format with Data Integration(.ktr file) as input to the Pentaho reports.

推荐答案

首先,最有可能是API的官方文档,其中一章为" 将报告引擎嵌入Java应用程序 "

First of all most probably there is official documentation to API, chapter "Embedding the Reporting Engine Into a Java Application"

编码非常简单

使用可视化工具创建报告,将数据源分配为.ktr文件,并以示例中的代码为例.

Create report using visual tool, assign data source as .ktr file, and code as example in tutorial.

只有您可能需要自定义* .ktr文件的路径,该路径可以通过官方API创建(很有可能),也可以在开始报告之前准备报告* .prpt.

Only u might need to customize path to *.ktr file which either can be made via official API (most probably) or prepare report *.prpt before to start report.

Pentaho Report Designer生成带有prpt扩展名的文件,这只是一个内部包含许多xml文件的zip文件.因此,您需要解压缩(java.util.zip),并将其解压缩到文件 datasources 的文件Kettle-ds.xml中.使用任何合适的xml解析器将路径更改为* .ktr文件,并将其打包回来.然后将自定义报告传递给报告引擎.

Pentaho Report Designer generate files with prpt extension which is just a zip file with a lot of xml files inside. So u need to unpack it (java.util.zip) and inside in folder datasources file kettle-ds.xml. Use any suitable xml parser to change path to *.ktr file and pack it back. Then pass customized report to report engine.

这篇关于用于创建Pentaho报告的Java代码,此报告接受输入作为数据集成(.ktr)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆