与JasperServer集成
Contents
[
Hide
]
要将 Aspose.Cells for JasperReports 集成到 JasperServer 中,请执行以下步骤。
In all of the following steps stands for the JasperServer installation directory.
- Add the following new exporter properties to the
\apache-tomcat\webapps\jasperserver\WEB-INF\flows\viewReportBeans.xml file.
XML
<bean id="reportACXlsExporter" class="com.aspose.cells.jasperreports.ACReportXlsExporter" parent="baseReportExporter">
<property name="exportParameters" ref="excelACExportParameters"/>
<property name="setResponseContentLength" value="true"/>
</bean>
<bean id="xlsACExporterConfiguration" class="com.jaspersoft.jasperserver.war.action.ExporterConfigurationBean">
<property name="descriptionKey" value="XLS - Excel Presentation via Aspose.Cells"/>
<property name="iconSrc" value="/images/xls.gif"/>
<property name="parameterDialogName" value="excelACExportParams"/>
<property name="exportParameters" ref="excelACExportParameters"/>
<property name="currentExporter" ref="reportACXlsExporter"/>
</bean>
- Locate the <util:map id=”exporterConfigMap> element in the
\apache-tomcat\webapps\jasperserver\WEB-INF\flows\viewReportBeans.xml file and add the following lines:
XML
<util:map id="exporterConfigMap">
<entry key="pdf" value-ref="pdfExporterConfiguration"/>
<entry key="xls" value-ref="xlsExporterConfiguration"/>
<entry key="rtf" value-ref="rtfExporterConfiguration"/>
<entry key="csv" value-ref="csvExporterConfiguration"/>
<entry key="swf" value-ref="swfExporterConfiguration"/>
<!-- START of ADDED LINES -->
<entry key="xls" value-ref="xlsACExporterConfiguration"/>
<!-- END of NEW LINES -->
</util:map>
- Copy all GIF images from the \lib folder in the aspose.cells.jasperreports.zip to the
\apache-tomcat\webapps\jasperserver\images folder. - Copy the aspose.cells.jasperreports.jar file from the \lib folder in the aspose.cells.jasperreports.zip to the
\apache-tomcat\webapps\jasperserver\WEB-INF\lib. folder. - Add the following lines to the
\apache-tomcat\webapps\jasperserver\WEB-INF\applicationContext.xml file. (此 bean 可包含用于配置导出的各种配置设置。例如,您可以使用 JasperReports 的字体映射功能或指定 Aspose.Cells for JasperReports 许可文件的位置。)
XML
<bean id="excelACExportParameters" class="com.aspose.cells.jasperreports.ACXlsExportParametersBean"> <!-- Uncomment to apply a license. Check the license path.
<property name="licenseFile" value="C:/jasperserver-3.0/apache-tomcat/webapps/jasperserver/WEB-INF/Aspose.Cells.JasperReports.lic"/>
-->
</bean>
- 运行JasperServer并打开任何报表进行查看。如果之前的步骤执行正确,额外的格式图标将可用。
安装 Aspose.Cells for JasperReports 到 JasperServer 后,右侧可用的新导出格式