本文介绍了JR报表不是在使用Struts 2的Linux上生成的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Linux中显示 JR 报告。我刚刚得到了一个错误,而产品大约在几个小时后。首先它在Windows上运行良好。我的应用程序服务器是 GlassFish 2.1 ,操作系统是 RedHat ,框架是 Struts 2

我感到沮丧,因为我的日志( GlassFish 服务器日志)中没有日志错误(异常)。我检查了连接,看起来很好(使用 jdbc ):

  public String getConnection(){
try {
Class.forName(org.apache.derby.jdbc.ClientDriver)。newInstance();
myConnectionObj = DriverManager.getConnection(jdbc:derby://127.0.0.1:1527 / timesheet_db; create = true; user = app; password = app);
返回SUCCESS;
} catch(Exception e){
e.printStackTrace();
返回错误;


My Struts 2 XML对于JR:

 < action name =ResourcePlan8
class =com .promo.accountsys.web.action.ReportResourcePlanAction
method =getConnection>
< result name =successtype =jasper>
< param name =location> /jasper/ResourcePlanConn9.jasper< / param>
< param name =dataSource> totalEffortProjectList< / param>
< param name =connection> myConnectionObj< / param>
< param name =format> PDF< / param>
< param name =dynamicReport> myDynamicReport< / param>
< param name =layoutManager> classic< / param>
< param name =documentName> Resouce_Plan< / param>
< param name =contentDisposition> application / download< / param>
< / result>
< result name =error> /jsp/report/initreport.jsp< / result>
< / action>

由于没有错误日志,我迷失了,我认为,也许在生成的报告中我错过了配置 Linux (仍然不确定)。我的朋友刚刚遇到了字体问题,但他正在使用 Birt 报告。他说,报告仍然以 Linux 中的默认字体生成,但是我的错误没有显示任何报告。当我将它移动到 Linux 时,我想我错过了一些配置。 设置属性net .sf.jasperreports.awt.ignore.missing.font在您的jrxml中为true并尝试。如果它生成报告,那么您可以通过使用 jasper报告的字体扩展名。


I've tried to show JR report in Linux. I got an error just now and the production is about in a few hours from now. First it worked fine on Windows. My application server is GlassFish 2.1, OS is RedHat, framework is Struts 2.

I get frustrated because there is no log error (exception) in my log (GlassFish server log). I've checked the connection, it seems fine (using jdbc):

public String getConnection() {
        try {
            Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
            myConnectionObj = DriverManager.getConnection ("jdbc:derby://127.0.0.1:1527/timesheet_db;create=true;user=app;password=app");
        return SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return ERROR;
        }
    } 

My Struts 2 XML for JR:

<action name="ResourcePlan8"
            class="com.promo.accountsys.web.action.ReportResourcePlanAction"
            method="getConnection">
            <result name="success" type="jasper">
                <param name="location">/jasper/ResourcePlanConn9.jasper</param>
                <param name="dataSource">totalEffortProjectList</param>
                <param name="connection">myConnectionObj</param>
                <param name="format">PDF</param>
                <param name="dynamicReport">myDynamicReport</param>
                <param name="layoutManager">classic</param>
                <param name="documentName">Resouce_Plan</param>
                <param name="contentDisposition">application/download</param>
            </result>
            <result name="error">/jsp/report/initreport.jsp</result>
        </action>

Because of the no error log I am lost I think, maybe in generated report I'm missing to configure Linux (still not sure). My friend just had a problem with font but he is using Birt report. He says the report is still generated with default font in Linux, but my error is not showing any report. I think I missed something to configure when I moved it to Linux.

解决方案

Set the property net.sf.jasperreports.awt.ignore.missing.font to true in your jrxml and try. If it generates the report then you can solve the issue by using the font extensions of jasper reports.

这篇关于JR报表不是在使用Struts 2的Linux上生成的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 08:23