Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jasper reports 在jasper报告的左侧显示垂直图像_Jasper Reports - Fatal编程技术网

Jasper reports 在jasper报告的左侧显示垂直图像

Jasper reports 在jasper报告的左侧显示垂直图像,jasper-reports,Jasper Reports,我想显示一个图像(借助iReport),如附件中所示。我想在第一页也显示它。如何设计此功能?使用IReport中的“背景”部分添加图像。 在所有其他部分中,为所有元素使用左边距,以便图像不会与其他元素重叠 使用下面的示例代码 <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http:


我想显示一个图像(借助iReport),如附件中所示。我想在第一页也显示它。如何设计此功能?

使用IReport中的“背景”部分添加图像。 在所有其他部分中,为所有元素使用左边距,以便图像不会与其他元素重叠

使用下面的示例代码

<?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="bgreport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
    <property name="ireport.zoom" value="0.9090909090909102"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="637"/>
    <queryString>
        <![CDATA[select 1 from dual]]>
    </queryString>
    <field name="?column?" class="java.lang.Integer"/>
    <background>
        <band height="802" splitType="Stretch">
            <image scaleImage="Clip">
                <reportElement x="0" y="0" width="113" height="802"/>
                <imageExpression class="java.lang.String"><![CDATA["/home/manideep/manideep/temp/cherry.jpg"]]></imageExpression>
            </image>
        </band>
    </background>
    <title>
        <band height="79" splitType="Stretch">
            <staticText>
                <reportElement x="112" y="0" width="100" height="79"/>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid"/>
                    <leftPen lineWidth="1.0" lineStyle="Solid"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid"/>
                </box>
                <textElement verticalAlignment="Middle"/>
                <text><![CDATA[Title]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch">
            <staticText>
                <reportElement x="112" y="0" width="100" height="35"/>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid"/>
                    <leftPen lineWidth="1.0" lineStyle="Solid"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid"/>
                </box>
                <textElement verticalAlignment="Middle"/>
                <text><![CDATA[Page Header]]></text>
            </staticText>
        </band>
    </pageHeader>
    <columnHeader>
        <band height="61" splitType="Stretch">
            <staticText>
                <reportElement x="112" y="0" width="100" height="61"/>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid"/>
                    <leftPen lineWidth="1.0" lineStyle="Solid"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid"/>
                </box>
                <textElement verticalAlignment="Middle"/>
                <text><![CDATA[Column Header]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="125" splitType="Stretch">
            <staticText>
                <reportElement x="112" y="0" width="100" height="125"/>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid"/>
                    <leftPen lineWidth="1.0" lineStyle="Solid"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid"/>
                </box>
                <textElement verticalAlignment="Middle"/>
                <text><![CDATA[Detail Band]]></text>
            </staticText>
        </band>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch">
            <staticText>
                <reportElement x="112" y="0" width="100" height="45"/>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid"/>
                    <leftPen lineWidth="1.0" lineStyle="Solid"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid"/>
                </box>
                <textElement verticalAlignment="Middle"/>
                <text><![CDATA[Column Footer]]></text>
            </staticText>
        </band>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch">
            <staticText>
                <reportElement x="112" y="0" width="100" height="54"/>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid"/>
                    <leftPen lineWidth="1.0" lineStyle="Solid"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid"/>
                </box>
                <textElement verticalAlignment="Middle"/>
                <text><![CDATA[Page Footer]]></text>
            </staticText>
        </band>
    </pageFooter>
    <summary>
        <band height="303" splitType="Stretch">
            <staticText>
                <reportElement stretchType="RelativeToBandHeight" x="112" y="0" width="100" height="303"/>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid"/>
                    <leftPen lineWidth="1.0" lineStyle="Solid"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid"/>
                </box>
                <textElement verticalAlignment="Middle"/>
                <text><![CDATA[Summary]]></text>
            </staticText>
        </band>
    </summary>
</jasperReport>


在ireport和所有其他波段中使用背景部分。。使用左边距不与所附图像上的其他详细信息重叠
/home/manideep/manideep/temp/cherry.jpg
根据需要更改此特定图像。如果您需要在页面侧设置垂直标题,此操作也适用于文本字段