spring-mvc之jasperreport html View 中的 nullpx

cmt 阅读:44 2024-10-01 17:34:08 评论:0

我的网络应用程序中需要一个报告。为此我在 iReport 中设计了一个 jrxml。我做了一个空白的 A4 模板。我已经编译了那个文件,然后把那个 jrxml 文件放到了我的类路径中。但是当我选择该 html View 时,该页面中显示了一个“X”图像。在查看源代码中,该元素给出为

<td><img alt="" src="nullpx" style="width: 46px; height: 1px;"/></td> 

我的jsxml文件是这样的

<?xml version="1.0" encoding="UTF-8"?> 
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="myreport" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a086f896-d28c-413e-8acc-416ff16d190a"> 
    <property name="ireport.zoom" value="1.0"/> 
    <property name="ireport.x" value="0"/> 
    <property name="ireport.y" value="0"/> 
    <field name="clientName" class="java.lang.String"/> 
    <field name="currentBalance" class="java.lang.Float"/> 
    <field name="creditLimit" class="java.lang.Float"/> 
    <background> 
        <band splitType="Stretch"/> 
    </background> 
    <title> 
        <band height="79" splitType="Stretch"/> 
    </title> 
    <pageHeader> 
        <band height="35" splitType="Stretch"/> 
    </pageHeader> 
    <columnHeader> 
        <band height="33" splitType="Stretch"> 
            <staticText> 
                <reportElement uuid="bc001d2d-32f7-4222-8155-79f0ebd97aa3" x="26" y="2" width="100" height="20"/> 
                <textElement/> 
                <text><![CDATA[clientName]]></text> 
            </staticText> 
            <staticText> 
                <reportElement uuid="15f41fea-5cad-43b4-809b-7285fb9fea9f" x="201" y="2" width="100" height="20"/> 
                <textElement/> 
                <text><![CDATA[currentBalance]]></text> 
            </staticText> 
            <staticText> 
                <reportElement uuid="16d187cb-beb0-4799-bdcf-5bfdb1583626" x="416" y="2" width="100" height="20"/> 
                <textElement/> 
                <text><![CDATA[creditLimit]]></text> 
            </staticText> 
        </band> 
    </columnHeader> 
    <detail> 
        <band height="38" splitType="Stretch"> 
            <textField> 
                <reportElement uuid="2cf8baa2-d1bc-46e2-a194-422d8d967f38" x="26" y="10" width="100" height="20"/> 
                <textElement/> 
                <textFieldExpression><![CDATA[$F{clientName}]]></textFieldExpression> 
            </textField> 
            <textField> 
                <reportElement uuid="6c560e8a-8020-453c-9f5c-84cf9a964391" x="201" y="10" width="100" height="20"/> 
                <textElement/> 
                <textFieldExpression><![CDATA[$F{currentBalance}]]></textFieldExpression> 
            </textField> 
            <textField> 
                <reportElement uuid="d8d431d9-8be9-46fb-bb43-3f4583c9c9e2" x="416" y="10" width="100" height="20"/> 
                <textElement/> 
                <textFieldExpression><![CDATA[$F{creditLimit}]]></textFieldExpression> 
            </textField> 
        </band> 
    </detail> 
    <columnFooter> 
        <band height="45" splitType="Stretch"/> 
    </columnFooter> 
    <pageFooter> 
        <band height="54" splitType="Stretch"/> 
    </pageFooter> 
    <summary> 
        <band height="42" splitType="Stretch"/> 
    </summary> 
</jasperReport> 

无论如何我可以在 html 页面中使用没有任何图像的 html ..

请您参考如下方法:

将 JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN 属性设置为“false”


标签:Spring
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

关注我们

一个IT知识分享的公众号