[英]Report job scheduling with custom data-source in jasper server 4.5.0
我正在使用Jasperserver 4.5.0 Pro。 我已经开发了一些其他功能的自定义数据源。 使用此自定义DS的所有报告都将正确执行,并在手动执行时显示正确的输出。 但是,当使用Jasper的报表作业计划程序计划相同的报表时,会话启动会出现一些问题,因此无法执行这些报表。
让我解释一下。
作为自定义DS的一部分,我必须更新以下2个xml-
viewReportFlow.xml:我更新了操作状态“ runReport”以使用我们的自定义DS执行器操作bean方法“ xmlHttpDsExecuterAction.setUpSession”来启动会话。 请参阅以下runReport标签-
<action-state id="runReport" xmlns:b="http://www.springframework.org/schema/webflow" xmlns:xi="http://www.w3.org/2001/XInclude">
<on-entry>
<evaluate expression="xmlHttpDsExecuterAction.setUpSession"/>
</on-entry>
<evaluate expression="viewReportActionBean"/>
<transition on="success" to="reportOutput"/>
<on-exit>
<evaluate expression="xmlHttpDsExecuterPageAction.setIndex"/>
</on-exit>
viewReportBeans.xml:我在此处定义了以上流程xml中使用的执行者操作bean-
<bean id="xmlHttpDsExecuterAction" class="com.sigma.reporting.xmlhttpds.XmlHttpDsExecuterAction" xmlns:xsi="http://www.w 3.org/2001/XMLSchema-instance"/> <bean id="xmlHttpDsExecuterPageAction" class="com.sigma.reporting.xmlhttpds.XmlHttpDsExecuterPageAction" xmlns:xsi="http://www.w 3.org/2001/XMLSchema-instance">
<property name="requestParameterPageIndex" value="pageIndex"/>
<property name="flowAttributePageIndex" value="pageIndex"/>
<property name="xmlHttpDataSourceName" value="com.sigma.reporting.xmlhttpds.XmlHttpDsExecuterDataSourceService"/>
<property name="repository">
<ref bean="repositoryService"/>
</property>
<property name="jasperPrintName" value="jasperPrintName"/>
<property name="reportUnitObject" value="reportUnitObject"/> </bean>
最终,在了解了japser服务器调度程序的流程之后,我得到了解决方案。 为了设置自定义数据源bean和调用函数,我们需要在$JASPER_HOME/apache-tomcat/weaaps/jasperserver-pro/WEBINF/flows/reportJobBeans.xml
指定bean目标,我们可以在reportJobFlow.xml中使用此bean。在jobOutput标签中
<view-state id="jobOutput" view="modules/reportScheduling/jobOutput">
<on-entry>
<set name="flowScope.prevForm" value="'jobOutput'"/>
<evaluate expression="reportOptionsJobEditAction.setOutputReferenceData"/>
<evaluate expression="xmlHttpDsExecuterAction.setUpSession"/>
</on-entry>
</view-state>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.