- Beranda
- Komunitas
- Tech
- Programmer Forum
[ask] jasper report buat field turun kebawah


TS
-sony-
[ask] jasper report buat field turun kebawah
mau tanya om, gimana caranya bikin jasper report itu hasil fieldnya turun kebawah ? bukan buat page baru terus 
misalnya gw ada field dengan
1. jumlahbarang
2. kodesatuan
3. namabarang
4. hargasatuan
5. hargatotal
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version last-->
<jasperReport >
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="MYSQL"/>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Table_TH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_TH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_CH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<parameter name="KODE_NOTA" class="java.lang.String">
<parameterDescription><![CDATA[kodenoa]]></parameterDescription>
</parameter>
<parameter name="TANGGAL_NOTA" class="java.lang.String">
<parameterDescription><![CDATA[tanggalnota]]></parameterDescription>
</parameter>
<parameter name="NAMA_PELANGGAN" class="java.lang.String">
<parameterDescription><![CDATA[nama pelanggan]]></parameterDescription>
</parameter>
<parameter name="DAERAH_PELANGGAN" class="java.lang.String">
<parameterDescription><![CDATA[daerah]]></parameterDescription>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<field name="JUMLAH_BARANG" class="java.lang.String"/>
<field name="KODE_SATUAN" class="java.lang.String"/>
<field name="NAMA_BARANG" class="java.lang.String"/>
<field name="HARGA_SATUAN" class="java.lang.String"/>
<field name="HARGA_TOTAL" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="80" splitType="Stretch">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
<staticText>
<reportElement uuid="66ec970b-6146-4e54-95fe-51881e3b538d" x="0" y="0" width="80" height="50"/>
<textElement verticalAlignment="Middle">
<font size="34"/>
</textElement>
<text><![CDATA[P]]></text>
</staticText>
<staticText>
<reportElement uuid="79e611d9-87b6-4464-8f66-ed4932a19159" x="180" y="0" width="120" height="19"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<text><![CDATA[TANGGAL]]></text>
</staticText>
<staticText>
<reportElement uuid="040d2b7c-351a-4aa7-b339-82f301364f88" x="180" y="19" width="120" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<text><![CDATA[TOKO]]></text>
</staticText>
<staticText>
<reportElement uuid="64f77585-8cdc-4495-9de0-ad87c6e7b315" x="80" y="60" width="70" height="20"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[NOTA NO :]]></text>
</staticText>
<textField>
<reportElement uuid="34d6425f-b6cb-4766-8c54-8ff85713d096" x="150" y="60" width="120" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{KODE_NOTA}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="35bd48c9-0976-4b78-b4d5-2bd71474ce13" x="320" y="0" width="234" height="19"/>
<textElement textAlignment="Center">
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{TANGGAL_NOTA}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="a30231ec-d808-4e86-8aa6-00dcf3604f97" x="320" y="19" width="235" height="21"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{NAMA_PELANGGAN}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="e72ef2a8-3bd3-44c2-bf28-a155162b69db" x="320" y="40" width="235" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{DAERAH_PELANGGAN}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="601" splitType="Stretch">
<staticText>
<reportElement uuid="ab9ef4f5-9cad-46c4-b4a1-5a4f7e21c90c" x="0" y="10" width="100" height="20"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[JUMLAH]]></text>
</staticText>
<staticText>
<reportElement uuid="2a8687df-4d2b-4f13-9fba-5489bd841db6" x="100" y="10" width="250" height="20"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[NAMA BARANG]]></text>
</staticText>
<staticText>
<reportElement uuid="28b28a87-95c9-4b6e-b6a9-9007dfa67a01" x="350" y="10" width="90" height="20"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[SATUAN]]></text>
</staticText>
<staticText>
<reportElement uuid="7f6846c9-8047-40e6-ba4c-479294e7b380" x="440" y="10" width="100" height="20"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[TOTAL]]></text>
</staticText>
<textField isStretchWithOverflow="true">
<reportElement uuid="3aeb19ee-7569-4bbb-9dbb-fdfd67fcf9d1" key="" x="0" y="30" width="60" height="270"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{JUMLAH_BARANG}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="28646705-53d5-4c58-a471-9e0767d94138" x="100" y="30" width="250" height="270"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{NAMA_BARANG}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="7d93c075-9e30-4325-99d2-8aaeff31f801" x="350" y="30" width="90" height="270"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{HARGA_SATUAN}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="184eda24-9463-462f-9d14-0f3ca16d2ad5" x="440" y="30" width="100" height="270"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{HARGA_TOTAL}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="ae551e71-8efb-4969-811c-fe3495c0523f" key="" x="60" y="30" width="40" height="270"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{KODE_SATUAN}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="121" splitType="Stretch"/>
</columnFooter>
</jasperReport>
int i=0;
Map DATA_TABEL[]=new HashMap[5];
while(i<5)
{
DATA_TABEL[i]=new HashMap();
DATA_TABEL[i].put("JUMLAH_BARANG", "1000 BH"+i);
DATA_TABEL[i].put("KODE_SATUAN","ROLL"+i);
DATA_TABEL[i].put("NAMA_BARANG", "123"+i);
DATA_TABEL[i].put("HARGA_SATUAN", "5000"+i);
DATA_TABEL[i].put("HARGA_TOTAL","100000"+i);
i++;
}
String output="F://Anto/NetBeansProjects/pore/src/pore/LAPORAN/CETAK_PIUTANG_NOTA.jasper";
JRMapArrayDataSource aa=new JRMapArrayDataSource(DATA_TABEL);
params.put("KODE_NOTA", "TES123");
params.put("TANGGAL_NOTA", "BBB");
params.put("NAMA_PELANGGAN","NAMA");
params.put("DAERAH_PELANGGAN", "DARAH");
//net.sf.jasperreports.engine.JRDataSource
try {
JasperPrint printer = JasperFillManager.fillReport(output, params, aa);
JasperViewer jv = new JasperViewer(printer);
jv.show();
} catch (JRException ex) {
ex.printStackTrace();
}
yg jadi maslaahnya hasil jasper itu selalu buat page baru bukan turun kebawah itu field
thx

misalnya gw ada field dengan
1. jumlahbarang
2. kodesatuan
3. namabarang
4. hargasatuan
5. hargatotal
Spoiler for code_jasper:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version last-->
<jasperReport >
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="MYSQL"/>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Table_TH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_TH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_CH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<parameter name="KODE_NOTA" class="java.lang.String">
<parameterDescription><![CDATA[kodenoa]]></parameterDescription>
</parameter>
<parameter name="TANGGAL_NOTA" class="java.lang.String">
<parameterDescription><![CDATA[tanggalnota]]></parameterDescription>
</parameter>
<parameter name="NAMA_PELANGGAN" class="java.lang.String">
<parameterDescription><![CDATA[nama pelanggan]]></parameterDescription>
</parameter>
<parameter name="DAERAH_PELANGGAN" class="java.lang.String">
<parameterDescription><![CDATA[daerah]]></parameterDescription>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<field name="JUMLAH_BARANG" class="java.lang.String"/>
<field name="KODE_SATUAN" class="java.lang.String"/>
<field name="NAMA_BARANG" class="java.lang.String"/>
<field name="HARGA_SATUAN" class="java.lang.String"/>
<field name="HARGA_TOTAL" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="80" splitType="Stretch">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
<staticText>
<reportElement uuid="66ec970b-6146-4e54-95fe-51881e3b538d" x="0" y="0" width="80" height="50"/>
<textElement verticalAlignment="Middle">
<font size="34"/>
</textElement>
<text><![CDATA[P]]></text>
</staticText>
<staticText>
<reportElement uuid="79e611d9-87b6-4464-8f66-ed4932a19159" x="180" y="0" width="120" height="19"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<text><![CDATA[TANGGAL]]></text>
</staticText>
<staticText>
<reportElement uuid="040d2b7c-351a-4aa7-b339-82f301364f88" x="180" y="19" width="120" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<text><![CDATA[TOKO]]></text>
</staticText>
<staticText>
<reportElement uuid="64f77585-8cdc-4495-9de0-ad87c6e7b315" x="80" y="60" width="70" height="20"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[NOTA NO :]]></text>
</staticText>
<textField>
<reportElement uuid="34d6425f-b6cb-4766-8c54-8ff85713d096" x="150" y="60" width="120" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{KODE_NOTA}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="35bd48c9-0976-4b78-b4d5-2bd71474ce13" x="320" y="0" width="234" height="19"/>
<textElement textAlignment="Center">
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{TANGGAL_NOTA}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="a30231ec-d808-4e86-8aa6-00dcf3604f97" x="320" y="19" width="235" height="21"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{NAMA_PELANGGAN}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="e72ef2a8-3bd3-44c2-bf28-a155162b69db" x="320" y="40" width="235" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{DAERAH_PELANGGAN}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="601" splitType="Stretch">
<staticText>
<reportElement uuid="ab9ef4f5-9cad-46c4-b4a1-5a4f7e21c90c" x="0" y="10" width="100" height="20"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[JUMLAH]]></text>
</staticText>
<staticText>
<reportElement uuid="2a8687df-4d2b-4f13-9fba-5489bd841db6" x="100" y="10" width="250" height="20"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[NAMA BARANG]]></text>
</staticText>
<staticText>
<reportElement uuid="28b28a87-95c9-4b6e-b6a9-9007dfa67a01" x="350" y="10" width="90" height="20"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[SATUAN]]></text>
</staticText>
<staticText>
<reportElement uuid="7f6846c9-8047-40e6-ba4c-479294e7b380" x="440" y="10" width="100" height="20"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[TOTAL]]></text>
</staticText>
<textField isStretchWithOverflow="true">
<reportElement uuid="3aeb19ee-7569-4bbb-9dbb-fdfd67fcf9d1" key="" x="0" y="30" width="60" height="270"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{JUMLAH_BARANG}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="28646705-53d5-4c58-a471-9e0767d94138" x="100" y="30" width="250" height="270"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{NAMA_BARANG}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="7d93c075-9e30-4325-99d2-8aaeff31f801" x="350" y="30" width="90" height="270"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{HARGA_SATUAN}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="184eda24-9463-462f-9d14-0f3ca16d2ad5" x="440" y="30" width="100" height="270"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{HARGA_TOTAL}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="ae551e71-8efb-4969-811c-fe3495c0523f" key="" x="60" y="30" width="40" height="270"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{KODE_SATUAN}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="121" splitType="Stretch"/>
</columnFooter>
</jasperReport>
Spoiler for javacode:
int i=0;
Map DATA_TABEL[]=new HashMap[5];
while(i<5)
{
DATA_TABEL[i]=new HashMap();
DATA_TABEL[i].put("JUMLAH_BARANG", "1000 BH"+i);
DATA_TABEL[i].put("KODE_SATUAN","ROLL"+i);
DATA_TABEL[i].put("NAMA_BARANG", "123"+i);
DATA_TABEL[i].put("HARGA_SATUAN", "5000"+i);
DATA_TABEL[i].put("HARGA_TOTAL","100000"+i);
i++;
}
String output="F://Anto/NetBeansProjects/pore/src/pore/LAPORAN/CETAK_PIUTANG_NOTA.jasper";
JRMapArrayDataSource aa=new JRMapArrayDataSource(DATA_TABEL);
params.put("KODE_NOTA", "TES123");
params.put("TANGGAL_NOTA", "BBB");
params.put("NAMA_PELANGGAN","NAMA");
params.put("DAERAH_PELANGGAN", "DARAH");
//net.sf.jasperreports.engine.JRDataSource
try {
JasperPrint printer = JasperFillManager.fillReport(output, params, aa);
JasperViewer jv = new JasperViewer(printer);
jv.show();
} catch (JRException ex) {
ex.printStackTrace();
}
yg jadi maslaahnya hasil jasper itu selalu buat page baru bukan turun kebawah itu field
thx
0
1.8K
Kutip
10
Balasan


Komentar yang asik ya
Urutan
Terbaru
Terlama


Komentar yang asik ya
Komunitas Pilihan