具体的项目配置,在这里不做过多的阐述,之前很多的文章都做了介绍,我这里直接给出结果:
第一步:下载报表环境birt-runtime-4_3_1,去官网下载,这里不做过多的阐述。
第二步:环境配置
1、解压缩,先拷贝WebViewerExampleWEB-INF下如下文件到工程的WEB-INF目录下:
jrun.web.xml
server-config.wsdd
viewer.properties
2、将WebViewerExampleWEB-INF lds下的birt.tld文件拷贝到工程的WEB-INF lds下
3、在工程的WEB-INF下建立report-engine的文件夹,在report-engine下新建如下四个文件夹
documents
images
logs
scriptlib
4、将WebViewerExample webcontent文件夹拷贝到要集成的WEB应用的根目录下(如果工程的web目录也叫WebContent的话会很奇怪,可以将webcontent改名,改名方法另开贴说明)。
5、在web应用的根目录下建立reportFiles文件夹,用来存放报表文件。
6、将web.xml中的如下内容拷贝到工程的web.xml中:
<display-name>Eclipse BIRT Report Viewer</display-name>
<!-- Default locale setting. -->
<context-param>
<param-name>BIRT_VIEWER_LOCALE</param-name>
<param-value>en-US</param-value>
</context-param>
<!--
Default timezone setting.
Examples: "Europe/Paris", "GMT+1".
Defaults to the container's timezone.
-->
<context-param>
<param-name>BIRT_VIEWER_TIMEZONE</param-name>
<param-value></param-value>
</context-param>
<!--
Report resources directory for preview. Defaults to ${birt home}
-->
<context-param>
<param-name>BIRT_VIEWER_WORKING_FOLDER</param-name>
<param-value></param-value>
</context-param>
<!--Temporary document files directory. Defaults to ${birt home}/documents-->
<context-param>
<param-name>BIRT_VIEWER_DOCUMENT_FOLDER</param-name>
<param-value></param-value>
</context-param>
<!--Flag whether the report resources can only be accessed under the
working folder. Defaults to true -->
<context-param>
<param-name>WORKING_FOLDER_ACCESS_ONLY</param-name>
<param-value>true</param-value>
</context-param>
<!--Settings for how to deal with the url report path. e.g. "http://host/repo/test.rptdesign".
Following values are supported: <all> - All paths.
<domain> - Only the paths with host matches current domain. Note the comparison is literal, "127.0.0.1" and "localhost" are considered as different hosts.
<none> - URL paths are not supported.
Defaults to "domain".
-->
<context-param>
<param-name>URL_REPORT_PATH_POLICY</param-name>
<param-value>domain</param-value>
</context-param>
<!--
Temporary image/chart directory. Defaults to ${birt home}/report/images
-->
<context-param>
<param-name>BIRT_VIEWER_IMAGE_DIR</param-name>
<param-value></param-value>
</context-param>
<!-- Engine log directory. Defaults to ${birt home}/logs -->
<context-param>
<param-name>BIRT_VIEWER_LOG_DIR</param-name>
<param-value></param-value>
</context-param>
<!-- Report engine log level -->
<context-param>
<param-name>BIRT_VIEWER_LOG_LEVEL</param-name>
<param-value>WARNING</param-value>
</context-param>
<!--
Directory where to store all the birt report script libraries (JARs).
Defaults to ${birt home}/scriptlib
-->
<context-param>
<param-name>BIRT_VIEWER_SCRIPTLIB_DIR</param-name>
<param-value></param-value>
</context-param>
<!-- Resource location directory. Defaults to ${birt home} -->
<context-param>
<param-name>BIRT_RESOURCE_PATH</param-name>
<param-value></param-value>
</context-param>
<!-- Preview report rows limit. An empty value means no limit. -->
<context-param>
<param-name>BIRT_VIEWER_MAX_ROWS</param-name>
<param-value></param-value>
</context-param>
<!--
Max cube fetch levels limit for report preview (Only used when
previewing a report design file using the preview pattern)
-->
<context-param>
<param-name>BIRT_VIEWER_MAX_CUBE_ROWLEVELS</param-name>
<param-value></param-value>
</context-param>
<context-param>
<param-name>BIRT_VIEWER_MAX_CUBE_COLUMNLEVELS</param-name>
<param-value></param-value>
</context-param>
<!-- Memory size in MB for creating a cube. -->
<context-param>
<param-name>BIRT_VIEWER_CUBE_MEMORY_SIZE</param-name>
<param-value></param-value>
</context-param>
<!-- Defines the BIRT viewer configuration file -->
<context-param>
<param-name>BIRT_VIEWER_CONFIG_FILE</param-name>
<param-value>WEB-INF/viewer.properties</param-value>
</context-param>
第一步:下载报表环境birt-runtime-4_3_1,去官网下载,这里不做过多的阐述。
第二步:环境配置
1、解压缩,先拷贝WebViewerExampleWEB-INF下如下文件到工程的WEB-INF目录下:
jrun.web.xml
server-config.wsdd
viewer.properties
2、将WebViewerExampleWEB-INF lds下的birt.tld文件拷贝到工程的WEB-INF lds下
3、在工程的WEB-INF下建立report-engine的文件夹,在report-engine下新建如下四个文件夹
documents
images
logs
scriptlib
4、将WebViewerExample webcontent文件夹拷贝到要集成的WEB应用的根目录下(如果工程的web目录也叫WebContent的话会很奇怪,可以将webcontent改名,改名方法另开贴说明)。
5、在web应用的根目录下建立reportFiles文件夹,用来存放报表文件。
6、将web.xml中的如下内容拷贝到工程的web.xml中:
<display-name>Eclipse BIRT Report Viewer</display-name>
<!-- Default locale setting. -->
<context-param>
<param-name>BIRT_VIEWER_LOCALE</param-name>
<param-value>en-US</param-value>
</context-param>
<!--
Default timezone setting.
Examples: "Europe/Paris", "GMT+1".
Defaults to the container's timezone.
-->
<context-param>
<param-name>BIRT_VIEWER_TIMEZONE</param-name>
<param-value></param-value>
</context-param>
<!--
Report resources directory for preview. Defaults to ${birt home}
-->
<context-param>
<param-name>BIRT_VIEWER_WORKING_FOLDER</param-name>
<param-value></param-value>
</context-param>
<!--Temporary document files directory. Defaults to ${birt home}/documents-->
<context-param>
<param-name>BIRT_VIEWER_DOCUMENT_FOLDER</param-name>
<param-value></param-value>
</context-param>
<!--Flag whether the report resources can only be accessed under the
working folder. Defaults to true -->
<context-param>
<param-name>WORKING_FOLDER_ACCESS_ONLY</param-name>
<param-value>true</param-value>
</context-param>
<!--Settings for how to deal with the url report path. e.g. "http://host/repo/test.rptdesign".
Following values are supported: <all> - All paths.
<domain> - Only the paths with host matches current domain. Note the comparison is literal, "127.0.0.1" and "localhost" are considered as different hosts.
<none> - URL paths are not supported.
Defaults to "domain".
-->
<context-param>
<param-name>URL_REPORT_PATH_POLICY</param-name>
<param-value>domain</param-value>
</context-param>
<!--
Temporary image/chart directory. Defaults to ${birt home}/report/images
-->
<context-param>
<param-name>BIRT_VIEWER_IMAGE_DIR</param-name>
<param-value></param-value>
</context-param>
<!-- Engine log directory. Defaults to ${birt home}/logs -->
<context-param>
<param-name>BIRT_VIEWER_LOG_DIR</param-name>
<param-value></param-value>
</context-param>
<!-- Report engine log level -->
<context-param>
<param-name>BIRT_VIEWER_LOG_LEVEL</param-name>
<param-value>WARNING</param-value>
</context-param>
<!--
Directory where to store all the birt report script libraries (JARs).
Defaults to ${birt home}/scriptlib
-->
<context-param>
<param-name>BIRT_VIEWER_SCRIPTLIB_DIR</param-name>
<param-value></param-value>
</context-param>
<!-- Resource location directory. Defaults to ${birt home} -->
<context-param>
<param-name>BIRT_RESOURCE_PATH</param-name>
<param-value></param-value>
</context-param>
<!-- Preview report rows limit. An empty value means no limit. -->
<context-param>
<param-name>BIRT_VIEWER_MAX_ROWS</param-name>
<param-value></param-value>
</context-param>
<!--
Max cube fetch levels limit for report preview (Only used when
previewing a report design file using the preview pattern)
-->
<context-param>
<param-name>BIRT_VIEWER_MAX_CUBE_ROWLEVELS</param-name>
<param-value></param-value>
</context-param>
<context-param>
<param-name>BIRT_VIEWER_MAX_CUBE_COLUMNLEVELS</param-name>
<param-value></param-value>
</context-param>
<!-- Memory size in MB for creating a cube. -->
<context-param>
<param-name>BIRT_VIEWER_CUBE_MEMORY_SIZE</param-name>
<param-value></param-value>
</context-param>
<!-- Defines the BIRT viewer configuration file -->
<context-param>
<param-name>BIRT_VIEWER_CONFIG_FILE</param-name>
<param-value>WEB-INF/viewer.properties</param-value>
</context-param>