私はArrayList
からジャスパー報告書を記入しようとしています。そのために、私はこのためのStringパラメーターを作成しました。次に、私はこのメソッドを持っています:ArrayListからレポートを入力する方法は?
私のレポートには、配列に複数のレコードがある場合、1行のデータしかありません。他の値を上書きすることができますか、何が間違っていますか?
マイjrxml:
<?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="porder" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="05f8fa07-cc11-4951-91d0-927112a15a81">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="PRODUCT_NAME" class="java.lang.String"/>
<parameter name="PRODUCT_UNITS" class="java.lang.String"/>
<parameter name="UNIT_COST" class="java.lang.String"/>
<parameter name="TOTAL_COST" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="8" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch">
<staticText>
<reportElement x="177" y="15" width="100" height="20" uuid="41147e24-6284-475c-b00c-96e980c79bbc"/>
<text><![CDATA[PURCHASE ORDER]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch">
<staticText>
<reportElement x="15" y="41" width="100" height="20" uuid="9dfd8b36-bc9b-49de-b9a9-b6d769d412d6"/>
<text><![CDATA[PRODUCT NAME]]></text>
</staticText>
<staticText>
<reportElement x="136" y="41" width="100" height="20" uuid="0eb87f16-3251-4736-9c7a-8ec69652da8c"/>
<text><![CDATA[PRODUCT UNITS]]></text>
</staticText>
<staticText>
<reportElement x="242" y="41" width="100" height="20" uuid="8a5f0b4c-b468-4791-9a5c-7b99431bef00"/>
<text><![CDATA[UNIT COST]]></text>
</staticText>
<staticText>
<reportElement x="353" y="41" width="100" height="20" uuid="7aadd922-f446-4e8b-b16b-fa61545936d6"/>
<text><![CDATA[TOTAL COST]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="23" splitType="Stretch">
<textField>
<reportElement x="14" y="3" width="112" height="20" uuid="faddcb7e-d047-4a35-9296-dd8a7d384e57"/>
<textFieldExpression><![CDATA[$P{PRODUCT_NAME}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="138" y="3" width="100" height="20" uuid="ee974e76-1698-4d41-95ca-e3254e6d8537"/>
<textFieldExpression><![CDATA[$P{PRODUCT_UNITS}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="243" y="3" width="100" height="20" uuid="7de5517f-5baa-489b-a4ad-b152df7523fb"/>
<textFieldExpression><![CDATA[$P{UNIT_COST}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="355" y="3" width="100" height="20" uuid="02a9f9a9-a81b-4f71-9e38-85b0ebdd0937"/>
<textFieldExpression><![CDATA[$P{TOTAL_COST}]]></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>
あなたはおそらくあなたがいる 'JREmptyDataSource' – MadProgrammer