若依+lodop+jasperreports+ireport 设计打印票据格式(二)
使用Field绑定Java传入数据
设计页表页数和当前页号


表格绑定数据

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="HYpdb" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="16515bc7-744b-43c7-8b4b-3a37e9b57403">
<property name="ireport.zoom" value="1.0000000000000007"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="tableList" uuid="1b7f8546-ab60-45af-a20a-2158a17027dd">
<field name="yYpmc" class="java.lang.String"/>
<field name="hCrdj" class="java.math.BigDecimal"/>
<field name="hCrdjSum" class="java.math.BigDecimal"/>
<field name="yCrjjSum" class="java.math.BigDecimal"/>
<field name="gxc" class="java.math.BigDecimal"/>
<field name="yCdmc" class="java.lang.String"/>
<field name="yScrq" class="java.util.Date"/>
<field name="yYxrq" class="java.util.Date"/>
<field name="yYpph" class="java.lang.String"/>
<field name="yPzwh" class="java.lang.String"/>
<field name="yYpgg" class="java.lang.String"/>
<field name="yCrjj" class="java.math.BigDecimal"/>
<field name="hCrsl" class="java.math.BigDecimal"/>
<field name="yDwmc" class="java.lang.String"/>
</subDataset>
<field name="hCrkVoList" class="java.util.Collection"/>
<field name="deptName" class="java.lang.String"/>
<field name="userName" class="java.lang.String"/>
<field name="listSize" class="java.lang.String"/>
<field name="hHdpzh" class="java.lang.String"/>
<field name="nowDate" class="java.lang.String"/>
<field name="yfmc" class="java.lang.String"/>
<field name="lwdw" class="java.lang.String"/>
<field name="sumDj" class="java.lang.String"/>
<field name="sumJj" class="java.lang.String"/>
<field name="djjjCe" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="48" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="403" height="48" uuid="9bc432eb-412f-4fa6-87bc-f4979bae2831"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="宋体" size="24"/>
</textElement>
<textFieldExpression><![CDATA[$F{deptName}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="403" y="0" width="23" height="48" uuid="43a7b71c-7e12-462a-977d-c5adde3f89cf"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="宋体" size="24"/>
</textElement>
<text><![CDATA[-]]></text>
</staticText>
<textField>
<reportElement x="426" y="0" width="376" height="48" uuid="afa8484c-037e-42ba-ae7f-48b95d97ab95"/>
<textElement verticalAlignment="Middle">
<font fontName="宋体" size="24"/>
</textElement>
<textFieldExpression><![CDATA[$F{yfmc}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="32" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="28" splitType="Stretch">
<textField>
<reportElement x="0" y="8" width="150" height="20" uuid="45fa7d17-689e-47a9-8ea4-3b34dde2db0c"/>
<textElement>
<font fontName="宋体"/>
</textElement>
<textFieldExpression><![CDATA[$F{lwdw}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="498" y="8" width="39" height="20" uuid="301c6d85-08c2-4977-9f7a-fb6b3a338abe"/>
<textElement>
<font fontName="宋体"/>
</textElement>
<text><![CDATA[页号:]]></text>
</staticText>
<textField>
<reportElement x="569" y="8" width="19" height="20" uuid="65b3af04-50bf-489a-919a-50353950514e"/>
<textElement textAlignment="Right">
<font fontName="宋体"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_COUNT}]]></textFieldExpression

博客介绍了使用若依、lodop、jasperreports、ireport设计打印票据格式的相关内容,包括用Field绑定Java传入数据、设计页表页数和当前页号、表格绑定数据、jrxml文件内容、Java代码编写以及分页等信息技术相关操作。
最低0.47元/天 解锁文章
1016

被折叠的 条评论
为什么被折叠?



