php - 如何使用 PHP Jasper 在 XML 数据源上使用多个 xpath 数据集?
问题描述
我在 Jasper Studio 中设计了一个使用 XML 作为数据源和两个 XPATH 数据集的报表。我能够生成报告,数据是从第一个数据集 (/data/invoice) 填充的,但第二个数据集 (/data/invoice_items/row) 未找到并返回 null。
如何为 'xml_xpath' => 添加第二个 xpath 到 php 脚本'/data/invoice_items/row'
这是我的 XML 数据:
<?xml version="1.0" encoding="utf-8"?>
<data>
<invoice>
<ID_Invoice>54654</ID_Invoice>
<Invoice_Code>FCS</Invoice_Code>
<Invoice_No>1</Invoice_No>
<Invoice_Date>09/08/2019</Invoice_Date>
<Seller_Name>Seller</Seller_Name>
<Seller_VAT_Code>123123</Seller_VAT_Code>
<Seller_Adress>New York</Seller_Adress>
<Seller_Email/>
<Partner_Name>John</Partner_Name>
<Partner_VAT_Code>123456789</Partner_VAT_Code>
<Partner_Adress>Atlanta</Partner_Adress>
<Partner_Email/>
</invoice>
<invoice_items>
<row>
<ID_Invoice_Row>29433</ID_Invoice_Row>
<Denumire>Product 1</Denumire>
<Valoare>555.0000</Valoare>
<VAT>0.0000</VAT>
<TOTAL>555.0000</TOTAL>
</row>
<row>
<ID_Invoice_Row>42345</ID_Invoice_Row>
<Denumire>Product 2</Denumire>
<Valoare>555.0000</Valoare>
<VAT>0.0000</VAT>
<TOTAL>555.0000</TOTAL>
</row>
<row>
<ID_Invoice_Row>11234</ID_Invoice_Row>
<Denumire>Product 3</Denumire>
<Valoare>555.0000</Valoare>
<VAT>0.0000</VAT>
<TOTAL>555.0000</TOTAL>
</row>
</invoice_items>
</data>
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="Factura" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="153c2ff6-b65d-49fa-80de-5c1a093eafcc">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="FC_XML"/>
<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_CH" mode="Opaque" backcolor="#BFE1FF">
<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>
<subDataset name="Factura_pozitii" uuid="1ee50e5a-b071-4886-8407-2ac843fb9ad1">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="FC_XML"/>
<queryString language="XPath">
<![CDATA[/data/invoice_items/row]]>
</queryString>
<field name="ID_Invoice_Row" class="java.lang.Integer">
<property name="net.sf.jasperreports.xpath.field.expression" value="ID_Invoice_Row"/>
<fieldDescription><![CDATA[ID_Invoice_Row]]></fieldDescription>
</field>
<field name="Denumire" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="Denumire"/>
<fieldDescription><![CDATA[Denumire]]></fieldDescription>
</field>
<field name="Valoare" class="java.lang.Float">
<property name="net.sf.jasperreports.xpath.field.expression" value="Valoare"/>
<fieldDescription><![CDATA[Valoare]]></fieldDescription>
</field>
<field name="VAT" class="java.lang.Float">
<property name="net.sf.jasperreports.xpath.field.expression" value="VAT"/>
<fieldDescription><![CDATA[VAT]]></fieldDescription>
</field>
<field name="TOTAL" class="java.lang.Float">
<property name="net.sf.jasperreports.xpath.field.expression" value="TOTAL"/>
<fieldDescription><![CDATA[TOTAL]]></fieldDescription>
</field>
</subDataset>
<queryString language="XPath">
<![CDATA[/data/invoice]]>
</queryString>
<field name="Seller_Name" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="Seller_Name"/>
<fieldDescription><![CDATA[Seller_Name]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="34" splitType="Stretch">
<textField>
<reportElement x="90" y="0" width="175" height="15" uuid="e9843cbc-f80d-4d43-ba3e-12abb7c1ed11"/>
<textFieldExpression><![CDATA[$F{Seller_Name}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="0" width="80" height="15" uuid="449ed594-81b1-420c-b361-55709bd951c7"/>
<text><![CDATA[Seller name:]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="92" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="555" height="60" uuid="93a83571-11ee-4173-9726-846f15cbdfec"/>
<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" whenNoDataType="Blank">
<datasetRun subDataset="Factura_pozitii" uuid="8a5ec067-61b0-4580-8aee-4fe353996db3">
<datasetParameter name="XML_DATA_DOCUMENT">
<datasetParameterExpression><![CDATA[$P{XML_DATA_DOCUMENT}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_INPUT_STREAM">
<datasetParameterExpression><![CDATA[$P{XML_INPUT_STREAM}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_FILE">
<datasetParameterExpression><![CDATA[$P{XML_FILE}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="net.sf.jasperreports.xml.source">
<datasetParameterExpression><![CDATA[$P{net.sf.jasperreports.xml.source}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_DATE_PATTERN">
<datasetParameterExpression><![CDATA[$P{XML_DATE_PATTERN}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_NUMBER_PATTERN">
<datasetParameterExpression><![CDATA[$P{XML_NUMBER_PATTERN}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_LOCALE">
<datasetParameterExpression><![CDATA[$P{XML_LOCALE}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_TIME_ZONE">
<datasetParameterExpression><![CDATA[$P{XML_TIME_ZONE}]]></datasetParameterExpression>
</datasetParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column width="40" uuid="d360ed7c-1960-426e-8541-07a125682d7e">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1"/>
<jr:detailCell style="Table_TD" height="15">
<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>
<textField>
<reportElement x="0" y="0" width="40" height="15" uuid="cdea816f-81e3-4b32-bec6-7791d9862c37"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="400" uuid="042fc8f1-a37e-412f-a4e8-f6f747d3054c">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement x="0" y="0" width="400" height="30" uuid="015596ef-4660-4c7f-9b6d-96b6ddf3858d"/>
<text><![CDATA[Denumire]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="15">
<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>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="400" height="15" isPrintWhenDetailOverflows="true" uuid="983e6d52-1734-4ace-b791-ec8cfc03cf7c"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{Denumire}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="69c6f7bc-1e99-4ced-afcd-adfc2d8930a9">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement x="0" y="0" width="50" height="30" uuid="0aa9d86a-dda0-469d-9923-b3d1e996b583"/>
<text><![CDATA[valoare]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="15">
<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>
<textField pattern="#,##0.###">
<reportElement x="0" y="0" width="50" height="15" uuid="11006503-d218-4a64-b8d4-240f611c4727"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{Valoare}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>
php代码:
use PHPJasper\PHPJasper;
$input = '/your_input_path/your_report.jasper';
$output = '/your_output_path';
$data_file = __DIR__ . '/your_data_files_path/your_xml_file.xml';
$options = [
'format' => ['pdf'],
'params' => [],
'locale' => 'en',
'db_connection' => [
'driver' => 'xml',
'data_file' => $data_file,
'xml_xpath' => '/data/invoice'
]
];
$jasper = new PHPJasper();
$jasper->process(
$input,
$output,
$options
)->execute();
如果我在终止时运行,它会说:
WARN JRXpathQueryExecuter:130 - 未提供 XML 源
我认为它适用于第二个数据集,因为第一个是可以的。
解决方案
目前,在您的 jrxml 中,您期望有两个数据源(1 个用于主数据源,1 个用于表),实际上此报告将在 JasperSoft Studio 中工作,例如定义正确的数据适配器。
但是,让我们仅使用 php 代码中定义的 1 个数据源来找到解决方案。
subDataSource
在 jasper 报告中,您可以通过在这种情况下在主数据源上使用来从 xml 数据源创建新数据源。
使用当前节点(记录)作为文档的根创建子数据源。一个附加的 XPath 表达式指定了应用于这个新文档的选择标准,并为数据源生成节点(记录)。
current node,是粗体,因为这是我们的第一个问题,您当前的主要 XPath 查询/data/invoice
太深,因为我们想在其上创建数据源data/invoice_items
解决方案
仅
data
在 php 和 jrxml 中的主 XPath 查询中选择。<queryString language="XPath"> <![CDATA[/data]]> </queryString>
相应地调整您的主要字段,您需要向下导航才能
invoice
看到fieldDescription
.<field name="Seller_Name" class="java.lang.String"> <property name="net.sf.jasperreports.xpath.field.expression" value="Seller_Name"/> <fieldDescription><![CDATA[invoice/Seller_Name]]></fieldDescription> </field>
subDataSource
为表创建<datasetRun subDataset="Factura_pozitii" uuid="8a5ec067-61b0-4580-8aee-4fe353996db3"> .. params .. <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/data/invoice_items/row")]]></dataSourceExpression> </datasetRun>
完成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="Factura" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="153c2ff6-b65d-49fa-80de-5c1a093eafcc">
<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_CH" mode="Opaque" backcolor="#BFE1FF">
<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>
<subDataset name="Factura_pozitii" uuid="1ee50e5a-b071-4886-8407-2ac843fb9ad1">
<queryString language="XPath">
<![CDATA[/data/invoice_items/row]]>
</queryString>
<field name="ID_Invoice_Row" class="java.lang.Integer">
<property name="net.sf.jasperreports.xpath.field.expression" value="ID_Invoice_Row"/>
<fieldDescription><![CDATA[ID_Invoice_Row]]></fieldDescription>
</field>
<field name="Denumire" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="Denumire"/>
<fieldDescription><![CDATA[Denumire]]></fieldDescription>
</field>
<field name="Valoare" class="java.lang.Float">
<property name="net.sf.jasperreports.xpath.field.expression" value="Valoare"/>
<fieldDescription><![CDATA[Valoare]]></fieldDescription>
</field>
<field name="VAT" class="java.lang.Float">
<property name="net.sf.jasperreports.xpath.field.expression" value="VAT"/>
<fieldDescription><![CDATA[VAT]]></fieldDescription>
</field>
<field name="TOTAL" class="java.lang.Float">
<property name="net.sf.jasperreports.xpath.field.expression" value="TOTAL"/>
<fieldDescription><![CDATA[TOTAL]]></fieldDescription>
</field>
</subDataset>
<queryString language="XPath">
<![CDATA[/data]]>
</queryString>
<field name="Seller_Name" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="Seller_Name"/>
<fieldDescription><![CDATA[invoice/Seller_Name]]></fieldDescription>
</field>
<columnHeader>
<band height="34" splitType="Stretch">
<textField>
<reportElement x="90" y="0" width="175" height="15" uuid="e9843cbc-f80d-4d43-ba3e-12abb7c1ed11"/>
<textFieldExpression><![CDATA[$F{Seller_Name}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="0" width="80" height="15" uuid="449ed594-81b1-420c-b361-55709bd951c7"/>
<text><![CDATA[Seller name:]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="92" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="555" height="60" uuid="93a83571-11ee-4173-9726-846f15cbdfec"/>
<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" whenNoDataType="Blank">
<datasetRun subDataset="Factura_pozitii" uuid="8a5ec067-61b0-4580-8aee-4fe353996db3">
<datasetParameter name="XML_DATE_PATTERN">
<datasetParameterExpression><![CDATA[$P{XML_DATE_PATTERN}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_NUMBER_PATTERN">
<datasetParameterExpression><![CDATA[$P{XML_NUMBER_PATTERN}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_LOCALE">
<datasetParameterExpression><![CDATA[$P{XML_LOCALE}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_TIME_ZONE">
<datasetParameterExpression><![CDATA[$P{XML_TIME_ZONE}]]></datasetParameterExpression>
</datasetParameter>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/data/invoice_items/row")]]></dataSourceExpression>
</datasetRun>
<jr:column width="40" uuid="d360ed7c-1960-426e-8541-07a125682d7e">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1"/>
<jr:detailCell style="Table_TD" height="15">
<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>
<textField>
<reportElement x="0" y="0" width="40" height="15" uuid="cdea816f-81e3-4b32-bec6-7791d9862c37"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="400" uuid="042fc8f1-a37e-412f-a4e8-f6f747d3054c">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement x="0" y="0" width="400" height="30" uuid="015596ef-4660-4c7f-9b6d-96b6ddf3858d"/>
<text><![CDATA[Denumire]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="15">
<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>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="400" height="15" isPrintWhenDetailOverflows="true" uuid="983e6d52-1734-4ace-b791-ec8cfc03cf7c"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{Denumire}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="69c6f7bc-1e99-4ced-afcd-adfc2d8930a9">
<jr:columnHeader style="Table_CH" height="30" rowSpan="1">
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement x="0" y="0" width="50" height="30" uuid="0aa9d86a-dda0-469d-9923-b3d1e996b583"/>
<text><![CDATA[valoare]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="15">
<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>
<textField pattern="#,##0.###">
<reportElement x="0" y="0" width="50" height="15" uuid="11006503-d218-4a64-b8d4-240f611c4727"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{Valoare}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>
推荐阅读
- python-3.x - 如何从不同的路径在 Jupyter 笔记本中打开 .csv 文件
- php - 如何使用 symfony5 通过 url 发送上传的文档
- haskell - 为什么字节串的 Data.Binary 实例将字节串的长度添加为前缀
- android - 如何在谷歌播放控制台中恢复到旧版本
- android - TYPO3 - 添加到主屏幕图标
- javascript - 您如何将 mongodb 的 ObjectID 转换为对象以便存储在数组中?
- linux - 将环境变量从 shell 脚本传递到 .dat 文件
- c++ - C ++如何使用argv [1]读取第一个用户参数并将其存储在字符串中以读取/写入文本文件
- android - 由于缺少 Android 模拟器,Gradle 脚本失败
- svelte - 将 dayjs 与 Sapper 一起使用