簡體   English   中英

在Jasper Server 4.5.0中使用自定義數據源報告作業計划

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

我正在使用Jasperserver 4.5.0 Pro。 我已經開發了一些其他功能的自定義數據源。 使用此自定義DS的所有報告都將正確執行,並在手動執行時顯示正確的輸出。 但是,當使用Jasper的報表作業計划程序計划相同的報表時,會話啟動會出現一些問題,因此無法執行這些報表。

讓我解釋一下。

  1. 對於手動執行報告-

作為自定義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>
  1. 對於報表的作業調度:我想使用調度程序實現與上述類似的操作。 在調查過程中,我試圖分析調度程序流,並嘗試進行更改,但到目前為止還算運氣。 誰能讓我知道通過調度程序運行報表所使用的流程,還可以建議上面配置自定義DS的地方?

最終,在了解了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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM