Home >Database >Mysql Tutorial >PentahoReportDesigner入门教程(二)

PentahoReportDesigner入门教程(二)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:03:181323browse

PentahoReport Designer 入门教程(二) 采用Pentaho Report Designer5.1版本,也是最新的版本。 一、 安装和介绍 介绍部分内容略,首先安装jdk,并配置java相关环境变量,下载pentaho report并解压,直接运行即可。 二、 第一个示例 三、在Swing程序中集成 示

PentahoReport Designer 入门教程(二)

采用Pentaho Report Designer5.1版本,也是最新的版本。

一、 安装和介绍

介绍部分内容略,首先安装jdk,并配置java相关环境变量,下载pentaho report并解压,直接运行即可。

二、 第一个示例

三、在Swing程序中集成

示例程序主要有三个部分,程序目录如下图:

\

1、 构建简单的Swing程序,显示两个按钮,分别是预览报表和关闭程序;

\点击Preview按钮,弹出报表页面。

\

 

2、 编写ant脚本,自动编译并运行程序(可选)

3、 嵌入报表相关内容,以及相应jar包说明

? 初始化报表引擎:

ClassicEngineBoot.getInstance().start();

? 报表资源文件加载代码:

ResourceManager manager = newResourceManager();

manager.registerDefaults();

Resource res = manager.createDirectly(new URL(

"file:data/ch2_1.prpt"), MasterReport.class);

MasterReport report = (MasterReport)res.getResource();

? 显示报表事件代码:

final PreviewDialog preview = newPreviewDialog(report);

preview.addWindowListener(newWindowAdapter() {

publicvoid windowClosing(final WindowEvent event){

preview.setVisible(false);

}

});

preview.pack();

preview.setVisible(true);

? 相关jar包说明

jar文件

说明

libbase.jar

libdocbundle.jar

libfonts.jar

libformat.jar

libformula.jar

libloader.jar

librepository.jar

libserializer.jar

libxml.jar

libswing.jar

pentaho-reporting-engine-classic-core.jar

pentaho-reporting-engine-classic-extensions.jar

报表引擎对应的jar包,5.1版本多了libswing.jar;每个jar文件名以版本结尾;必需;

commons-logging-api.jar

日志使用,必需;

poi-3.9.jar

poi-ooxml-3.9.jar

poi-ooxml-schemas-3.9.jar

xmlbeans-2.5.0.jar

dom4j-1.6.1.jar

 

生成excel相关文件;可选;

itext-2.1.7.jar

生成pdf;可选;

itext-rtf-2.1.7.jar

rtf文件;可选;

四、在j2ee程序中集成

待续。。。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn