Jasper reports 报告的详细带边框列表

Jasper reports 报告的详细带边框列表,jasper-reports,Jasper Reports,我想为标注栏细节中的元素列表创建边框,边框必须是标注栏细节的大小,它应该是: 在上面的图片中,是我想要的格式,但我做不到,我放了一个带细节大小的矩形,但是对于列表中的每个元素,都用我放的矩形创建了一行,所以这是错误的,我想知道如何创建静态边框作为图片,无论元素列表的大小,边框的大小始终与标注栏细节的大小相同。我假设您使用的是jasper report studio中的元素“Table”。如果选择列,请转到“边框”选项卡 首先选择大于0的“笔宽” 然后选择“默认边框样式”为四边形 在选择样式之前,

我想为标注栏细节中的元素列表创建边框,边框必须是标注栏细节的大小,它应该是:


在上面的图片中,是我想要的格式,但我做不到,我放了一个带细节大小的矩形,但是对于列表中的每个元素,都用我放的矩形创建了一行,所以这是错误的,我想知道如何创建静态边框作为图片,无论元素列表的大小,边框的大小始终与标注栏细节的大小相同。

我假设您使用的是jasper report studio中的元素“Table”。如果选择列,请转到“边框”选项卡

首先选择大于0的“笔宽”

然后选择“默认边框样式”为四边形

在选择样式之前,必须先选择笔宽

对每个列分别执行此操作

希望对您有所帮助

您可以试试这个

<?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="sampleDynamicJasperDesign" pageWidth="595" pageHeight="842" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="20" bottomMargin="20" uuid="f6525a83-6266-4c65-b19b-e8974a462453">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Sans_Normal" isDefault="true" fontName="DejaVu Sans" fontSize="12" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<field name="firstName" class="java.lang.String"/>
<field name="lastName" class="java.lang.String"/>
<field name="age" class="java.lang.Integer"/>
<title>
    <band height="20">
        <rectangle>
            <reportElement x="0" y="0" width="515" height="20" uuid="37ccd9d9-942a-4727-b124-dc164b811225"/>
        </rectangle>
        <staticText>
            <reportElement mode="Transparent" x="0" y="0" width="515" height="20" forecolor="#110D0D" backcolor="#F9F7F7" uuid="33c2fe57-3d87-4057-b6e0-f7eefc14abb1"/>
            <textElement textAlignment="Center"/>
            <text><![CDATA[This is title band]]></text>
        </staticText>
    </band>
</title>
<columnHeader>
    <band height="20">
        <textField>
            <reportElement x="320" y="0" width="195" height="20" uuid="aea6e23f-70bc-4a02-9ace-58dbdbea38a6"/>
            <box>
                <pen lineWidth="2.0" lineColor="#FF4532"/>
            </box>
            <textElement markup="html"/>
            <textFieldExpression><![CDATA["Age"]]></textFieldExpression>
        </textField>
        <textField>
            <reportElement x="160" y="0" width="160" height="20" uuid="d833d2e5-a461-4151-b3b4-f414b0860213"/>
            <box>
                <pen lineWidth="2.0" lineColor="#FF4532"/>
            </box>
            <textFieldExpression><![CDATA["Last Name"]]></textFieldExpression>
        </textField>
        <textField>
            <reportElement mode="Opaque" x="0" y="0" width="160" height="20" uuid="27edec93-cc98-410b-b1b1-90f0acc39f72"/>
            <box>
                <pen lineWidth="2.0" lineColor="#FF4532"/>
            </box>
            <textFieldExpression><![CDATA["First Name"]]></textFieldExpression>
        </textField>
    </band>
</columnHeader>
<detail>
    <band height="20">
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="160" height="20" uuid="a1bf44d8-97fb-48ee-abe4-0d15f3b0d8fc"/>
            <box>
                <leftPen lineWidth="2.0" lineColor="#FF4532"/>
                <rightPen lineWidth="2.0" lineColor="#1B6CFF"/>
            </box>
            <textFieldExpression><![CDATA["First Name: "+$F{firstName}]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="160" y="0" width="160" height="20" uuid="b13594b0-f243-44a2-b628-f7f9c3ee1869"/>
            <box>
                <rightPen lineWidth="2.0" lineColor="#1B6CFF"/>
            </box>
            <textFieldExpression><![CDATA[$F{lastName}+" :Last Name"]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="320" y="0" width="195" height="20" uuid="9319ca54-0b8b-4d57-ae5c-eab44a70549c"/>
            <box>
                <leftPen lineWidth="2.0" lineColor="#1B6CFF"/>
                <rightPen lineWidth="2.0" lineColor="#FF4532"/>
            </box>
            <textElement markup="html"/>
            <textFieldExpression><![CDATA["<html><font color=\"#66FF33\">"+"Age is: "+"</font><font color=\"#6600FF\">"+$F{age}+"</font></html>"]]></textFieldExpression>
        </textField>
    </band>
</detail>
<summary>
    <band height="1">
        <line>
            <reportElement x="0" y="0" width="515" height="1" uuid="ee544ff1-4c19-45b7-9a44-8dca649d9317"/>
        </line>
    </band>
</summary>
</jasperReport>
您还可以从这里看到代码实现。


享受。

我不明白你说的边框总是和乐队细节一样大。哪一个边框以及你所说的条带细节尺寸是什么意思?好的,请原谅我的英语,我想为每一列放置一个框架或矩形,如上图所示,但框架o矩形的尺寸必须与页面中条带细节的尺寸相同。你想让每一列的边框与左上角的项目块相同吗?但是他们各自的尺寸,明白了。我曾面临过类似的问题。有时要把边界弄对是很棘手的。