这段时间用Jasper画报表,讲真的Jasper IDE真的很难用,网上找很久都没找到用table画的配置方法,以下是直接操作源码画table的方法,不用IDE一样可以做出来(不过样式还是得借助IDE拖拽调整容易些),以下是简要介绍,如果你对Jasper比较熟悉,只需得知table数据源的配置方式可以跳过前面的直接看table设置:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.0.final using JasperReports Library version 6.4.1 -->
<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="CC_RESULT_INV" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="5d4aa9eb-83ee-4f4d-a663-80ec6888dacb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="iwms\inner\dataAdapter\count_result_inv.xml"/>(配置适配器)
<property name="net.sf.jasperreports.print.create.bookmarks" value="false"/>
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<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_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>
<subDataset name="count_result_inv" uuid="86287dda-f4b9-4a82-ad21-41fe0aa75034">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="iwms\inner\dataAdapter\count_result_inv.xml"/>(数据源配置  以下的field是table里的参数
<field name="num" class="java.lang.Integer">
<property name="net.sf.jasperreports.json.field.expression" value="num"/>
<fieldDescription><![CDATA[num]]></fieldDescription>
</field>
<field name="ownerCode" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="ownerCode"/>
<fieldDescription><![CDATA[ownerCode]]></fieldDescription>
</field>
<field name="ownerName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="ownerName"/>
<fieldDescription><![CDATA[ownerName]]></fieldDescription>
</field>
<field name="barcode" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="barcode"/>
<fieldDescription><![CDATA[barcode]]></fieldDescription>
</field>
<field name="skuName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="skuName"/>
<fieldDescription><![CDATA[skuName]]></fieldDescription>
</field>
<field name="size" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="size"/>
<fieldDescription><![CDATA[size]]></fieldDescription>
</field>
<field name="color" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="color"/>
<fieldDescription><![CDATA[color]]></fieldDescription>
</field>
<field name="styleNum" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="styleNum"/>
<fieldDescription><![CDATA[styleNum]]></fieldDescription>
</field>
<field name="brand" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="brand"/>
<fieldDescription><![CDATA[brand]]></fieldDescription>
</field>
<field name="lot" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="lot"/>
<fieldDescription><![CDATA[lot]]></fieldDescription>
</field>
<field name="loc" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="loc"/>
<fieldDescription><![CDATA[loc]]></fieldDescription>
</field>
<field name="lpn" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="lpn"/>
<fieldDescription><![CDATA[lpn]]></fieldDescription>
</field>
<field name="caseNum" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="caseNum"/>
<fieldDescription><![CDATA[caseNum]]></fieldDescription>
</field>
<field name="systemQty" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="systemQty"/>
<fieldDescription><![CDATA[systemQty]]></fieldDescription>
</field>
<field name="qty" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="qty"/>
<fieldDescription><![CDATA[qty]]></fieldDescription>
</field>
<field name="diffQty" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="diffQty"/>
<fieldDescription><![CDATA[diffQty]]></fieldDescription>
</field>
<field name="countTime" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="countTime"/>
<fieldDescription><![CDATA[countTime]]></fieldDescription>
</field>
</subDataset>
<parameter name="tenantId" class="java.lang.Long">(parameter 是获取报表需要的参数)
<parameterDescription><![CDATA[租户ID]]></parameterDescription>
</parameter>
<parameter name="warehouseCode" class="java.lang.String">
<parameterDescription><![CDATA[仓库编码]]></parameterDescription>
</parameter>
<parameter name="countNum" class="java.lang.String">
<parameterDescription><![CDATA[盘点单号]]></parameterDescription>
</parameter>
<parameter name="operatorId" class="java.lang.Long">
<parameterDescription><![CDATA[制单人ID]]></parameterDescription>
</parameter>
<parameter name="operatorName" class="java.lang.String">
<parameterDescription><![CDATA[制单人名称]]></parameterDescription>
</parameter>
<queryString language="jsonql">
<![CDATA[po]]>
</queryString>(此处很关键 数据入口)
<field name="startCountTime" class="java.lang.String">(以下field是table外的数据配置)
<propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$.po.startCountTime"]]></propertyExpression>(根据自己的数据结构设置)
<fieldDescription><![CDATA[startCountTime]]></fieldDescription>
</field>
<field name="endCountTime" class="java.lang.String">
<propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$.po.endCountTime"]]></propertyExpression>
<fieldDescription><![CDATA[endCountTime]]></fieldDescription>
</field>
<field name="countNum" class="java.lang.String">
<propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$.po.countNum"]]></propertyExpression>
<fieldDescription><![CDATA[countNum]]></fieldDescription>
</field>
<field name="printUser" class="java.lang.String">
<propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$.po.printUser"]]></propertyExpression>
<fieldDescription><![CDATA[printUser]]></fieldDescription>
</field>
<field name="printTime" class="java.lang.String">
<propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$.po.printTime"]]></propertyExpression>
<fieldDescription><![CDATA[printTime]]></fieldDescription>
</field>
<title>(以下是报表的title部分 table以外的数据
<band height="51" splitType="Stretch">
<staticText>
<reportElement x="300" y="5" width="120" height="46" uuid="31b1855e-439d-449f-9591-6e16996760db"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="28" isBold="true"/>
</textElement>
<text><![CDATA[盘点结果]]></text>
</staticText>
<componentElement>
<reportElement x="666" y="2" width="134" height="46" uuid="fea5b4d4-e6ec-42fd-82d5-59e4158cfd79">
<property name="com.jaspersoft.studio.unit.barHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.barWidth" value="pixel"/>
</reportElement>
<jr:barbecue xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" type="Code128" drawText="true" checksumRequired="false" barHeight="80">
<jr:codeExpression><![CDATA[$F{countNum}]]></jr:codeExpression>
</jr:barbecue>(条形码设置)
</componentElement>
<staticText>
<reportElement x="422" y="25" width="78" height="24" uuid="191f0487-b4e5-45c6-bf7d-d38196eae32c"/>
<textElement verticalAlignment="Bottom">
<font fontName="微软雅黑" size="14" isBold="true"/>
</textElement>
<text><![CDATA[按库存明细]]></text>
</staticText>
<staticText>
<reportElement x="10" y="10" width="70" height="20" uuid="b859a323-a943-49fa-b72c-7eb2a44ec43f">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[开始盘点时间:]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="80" y="10" width="60" height="20" uuid="ea625a37-da6a-4cfd-8504-703266ae40b8">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{startCountTime}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="30" width="70" height="20" uuid="b859a323-a943-49fa-b72c-7eb2a44ec43f">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[结束盘点时间:]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="80" y="31" width="60" height="20" uuid="ea625a37-da6a-4cfd-8504-703266ae40b8">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{endCountTime}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</band>
</pageHeader>
<detail>
<band height="100" splitType="Stretch">
<componentElement>
<reportElement x="0" y="4" width="800" height="96" uuid="744b22a9-27f5-4996-93c9-bc7f9747e36f">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/>
<property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>
<property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>
</reportElement>

以下是本文的关键 table 如果你对其他很熟悉只需看这里和上面的count_result_inv数据配置和数据的使用格式即可
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="count_result_inv" uuid="9ea6754d-e599-4deb-8c74-80c26377ff02"> (table数据源设置 和之前设置的数据源相同)
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("details")]]></dataSourceExpression>(details便是table里需要的列表数据 对应你自己的参数名)
</datasetRun>

(以下是table里的结构 列名和对应的参数设置)
<jr:column width="40" uuid="7419436a-d528-4a26-acc9-8a5b5cd7ab97">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="0a953536-f431-4d02-984e-e4e63d99271c"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[序号]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="40" height="30" uuid="bf44b38f-9722-465c-911b-0e56358f4650"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{num}]]></textFieldExpression>(参数设置 对应数据源的参数名)
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="0cff022e-5c39-4b32-b6f6-c72d62173d3c">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="50" height="30" uuid="847baa13-0ab9-410d-bd7b-4dddb144e3cc"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[货主编码]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="cb40707d-9b0d-4969-bbd0-ae5ee281d3c0"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{ownerCode}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="54" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="54" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[货主名称]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="54" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{ownerName}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="0cff022e-5c39-4b32-b6f6-c72d62173d3c">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="50" height="30" uuid="847baa13-0ab9-410d-bd7b-4dddb144e3cc"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[商品条码]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="cb40707d-9b0d-4969-bbd0-ae5ee281d3c0"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{barcode}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="56" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="56" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[商品名称]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="56" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{skuName}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="0cff022e-5c39-4b32-b6f6-c72d62173d3c">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="847baa13-0ab9-410d-bd7b-4dddb144e3cc"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[款号]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="40" height="30" uuid="cb40707d-9b0d-4969-bbd0-ae5ee281d3c0"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{styleNum}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="36" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="36" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[颜色]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="36" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{color}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[尺码]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="40" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{size}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[品牌]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="40" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{brand}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="66" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="66" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[批次]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="66" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{lot}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="58" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="58" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[库位]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="58" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{loc}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="50" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[LPN]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{lpn}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="46" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="46" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[箱号]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="46" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{caseNum}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[库存量]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="40" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{systemQty}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[盘点量]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="40" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{qty}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[差异量]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="40" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{diffQty}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="56" uuid="ad2d764d-26cf-45b9-b95b-c981f56fbfe4">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="56" height="30" uuid="4e6f71e0-54ba-4097-80eb-53427306f0b1"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[盘点时间]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="56" height="30" uuid="18533c81-f490-48db-a5cf-14d03eee6031"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{countTime}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
<columnFooter>
<band splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</band>
</columnFooter>
<pageFooter>(以下也是table外数据设置)
<band height="93">
<staticText>
<reportElement x="10" y="0" width="53" height="20" uuid="5a81f2b8-edc5-42c0-9c06-4767a8ecb031">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[制 单 人 :]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="63" y="0" width="80" height="20" uuid="0c06794d-81f4-454c-b4cc-20d4f87ed2b4">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{printUser}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="150" y="0" width="53" height="20" uuid="5a81f2b8-edc5-42c0-9c06-4767a8ecb031">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<text><![CDATA[制 单时间:]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="203" y="0" width="147" height="20" uuid="0c06794d-81f4-454c-b4cc-20d4f87ed2b4">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="微软雅黑" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{printTime}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</band>
</summary>
</jasperReport>

我的数据格式:

{
"po": {
"countNum": "123456789",
"startCountTime": "1000",
"endCountTime": "1000",
"printUser": "1000",
"printTime": "1000",
details:
[
{
"num": "1",
"ownerCode": "OW2913221",
"ownerName": "张三",
"barcode": "SKU201708250822",
"skuName":"好商品不要用选",
"size": "102",
"color": "红",
"styleNum": "25",
"brand": "1000",
"lot": "1000",
"loc": "1000",
"lpn": "1000",
"caseNum": "1",
"systemQty": "100",
"qty": "10",
"diffQty": "-90",
"countTime": "1000"
},
{
"num": "1",
"ownerCode": "OW2913221",
"ownerName": "张三",
"barcode": "SKU201708250822",
"skuName":"好商品不要用选",
"size": "102",
"color": "红",
"styleNum": "25",
"brand": "1000",
"lot": "1000",
"loc": "1000",
"lpn": "1000",
"caseNum": "1",
"systemQty": "100",
"qty": "10",
"diffQty": "-90",
"countTime": "1000"
}]
}
}

报表效果:

Jasper之table报表的更多相关文章

  1. jasper使用table组件设计复杂的表头

    1.1 设计报表模板 1.1.1 新建模板DemoReport5.jrxml,去掉不需要的Band,保留Title,Page Header,Detail 1 , PageFooter.将组件Table ...

  2. 如何将jsp页面的table报表转换到excel报表导出

    假设这就是你的jsp页面: 我们会添加一个“导出到excel”的超链接,它会把页面内容导出到excel文件中.那么这个页面会变成这个样子 在此,强调一下搜索时关键词的重要性,这样一下子可以定位到文章, ...

  3. iReport 4.1 报表制作,子报表,实例解析

    开发使用步骤(iReport 4.1.1) (个人总结,如有问题请留言,另外知道table控件用法的给我留言或者发邮件谢谢.Email:jiazx0107@163.com) 目录 1.      开发 ...

  4. [原创]Devexpress XtraReports 系列 4 创建多栏报表

    昨天我们完成了 [原创]Devexpress XtraReports 系列 3 创建主从报表 今天我们继续学习新的一种报表模式:多栏报表.(Demo源码,数据库最后附上) 或许很多人会问什么是多栏报表 ...

  5. openerp经典收藏 深入理解报表运行机制(转载)

    深入理解报表运行机制 原文:http://blog.sina.com.cn/s/blog_57ded94e01014ppd.html 1) OpenERP报表的基本运行机制    OpenERP报表的 ...

  6. 利用程序将.jrxml导出为.jasper文件并用PDF显示(2)

    直接在Web项目中使用.jasper文件,其实在软件项目开发时,.jrxml文件经常修改,而且.jrxml还要在项目中进行保留备份,所以较为流行的做法是在项目中使用.jrxml来生成.jasper文件 ...

  7. Devexpress Xtrareports 创建多栏报表

    根据官方回答:多列或多行(取决于当前的多栏设置)呈现数据的报表 这种报表是有用的,例如,当每个明细区都只显示少量数据.并且需要在一列的右侧打印下一个明细区时,这样就能充分利用整个页面的宽度,此外,当创 ...

  8. Logical Databases逻辑数据库

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  9. 青铜器RDM全面支持CMMI、GJB5000A L2~L5认证评估

    青铜器RDM全面实现对CMMI L4.GJB5000A L4的100%支持,并且已经成为众多组织CMMI.GJB5000A落地执行的有效手段,避免认证与执行2张皮,有利于体系的贯彻执行,以下是青铜器R ...

随机推荐

  1. python calendar(日历)模块

    内置函数month() #!/usr/bin/python import calendar print calendar.month(2017,12) 输出: December 2017 Mo Tu ...

  2. 12.python进程\协程\异步IO

    进程 创建进程 from multiprocessing import Process import time def func(name): time.sleep(2) print('hello', ...

  3. CSS 参考手册

    CSS3 动画属性(Animation) 属性 描述 CSS @keyframes 规定动画. 3 animation 所有动画属性的简写属性,除了 animation-play-state 属性. ...

  4. Linux sftp 另外一台机器时,出现:receive message is too long

    因为在linux登录时,首先会运行的三个文件是: /etc/profile,/home/用户名/.bashrc,其次是/home/用户名/.bash_profile,出现这个问题的原因是因为在sftp ...

  5. Java学习笔记14(面向对象七:final、static)

    final:意为最终,不可变,是一个修饰词 有时候一个类地功能被开发好了,不想让子类重写,修改,这里就会用到final关键字 final修饰类: 不可以被继承,但是可以继承其他类 示例: public ...

  6. F# 之旅(下)

    写在前面的话 学习 F# 一定要去体会函数式编程的特点,推荐一下阮一峰的日志<函数式编程入门教程>. 在这篇文章中 递归函数 记录和可区分联合类型 模式匹配 可选类型 度量单位 类和接口 ...

  7. Unity3d 协程

    参考文章: http://blog.csdn.net/onafioo/article/details/48979939 http://www.cnblogs.com/zhaoqingqing/p/37 ...

  8. nginx的配置

    1. brew install nginx 2.brew services list 3.brew services start nginx 4.brew servicies stop nginx 5 ...

  9. python * 的区别

    >>> ['Spam']*5 ['Spam', 'Spam', 'Spam', 'Spam', 'Spam'] >>> ['Spam'*5] ['SpamSpamS ...

  10. Python => ValueError: unsupported format character 'Y' (0x59)

    产生问题的原因是:SQL语句的'%Y-%m-%d'部分被再次解释为字符串格式,并抛出错误 解决方案一:字符串%形式进行替换 '%string' % string. '%Y-%m-%d'改写为'%%%% ...