简体   繁体   English

在Jasper Server 4.5.0中使用自定义数据源报告作业计划

[英]Report job scheduling with custom data-source in jasper server 4.5.0

I am using Jasperserver 4.5.0 Pro. 我正在使用Jasperserver 4.5.0 Pro。 I have developed a custom data-source for some additional feature. 我已经开发了一些其他功能的自定义数据源。 All reports that use this custom DS get executed properly and show the correct output when executed manually. 使用此自定义DS的所有报告都将正确执行,并在手动执行时显示正确的输出。 But when the same reports are scheduled using Jasper's report job scheduler, there is some problem with session initiation, and hence the reports do not get executed. 但是,当使用Jasper的报表作业计划程序计划相同的报表时,会话启动会出现一些问题,因此无法执行这些报表。

Let me explain this a bit. 让我解释一下。

  1. For manual execution of reports - 对于手动执行报告-

As part of custom DS, I had to update the following 2 xmls - 作为自定义DS的一部分,我必须更新以下2个xml-

viewReportFlow.xml : I updated the action state 'runReport' to use our custom DS executer action bean method 'xmlHttpDsExecuterAction.setUpSession' to start session. viewReportFlow.xml:我更新了操作状态“ runReport”以使用我们的自定义DS执行器操作bean方法“ xmlHttpDsExecuterAction.setUpSession”来启动会话。 Please see the below tag of runReport - 请参阅以下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 : I defined the executer action beans used in above flow xml here - 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>
  1. For job scheduling of reports : I want to implement similarly as above using scheduler. 对于报表的作业调度:我想使用调度程序实现与上述类似的操作。 During my investigations, I have tried to analyze the scheduler flow, and tried to put our changes, but no luck so far. 在调查过程中,我试图分析调度程序流,并尝试进行更改,但到目前为止还算运气。 Can any one please let me know what flows are used for running reports via scheduler and also please recommend the places to configure custom DS as above? 谁能让我知道通过调度程序运行报表所使用的流程,还可以建议上面配置自定义DS的地方?

Finally after understanding the flow of japser server scheduler i have got the solution for this. 最终,在了解了japser服务器调度程序的流程之后,我得到了解决方案。 For setting your custom data source beans and calling the function,we need to specify the bean destination in $JASPER_HOME/apache-tomcat/weaaps/jasperserver-pro/WEBINF/flows/reportJobBeans.xml and we can use this bean in reportJobFlow.xml in jobOutput tag lik this 为了设置自定义数据源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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM