我正在尝试在iReport中使用XML数据源与odoo集成创建报告。现在问题是我得到M2O和O2M文件的空值。
我应该如何获取报告中这些字段的值? 提前谢谢。
这是我报告的jrxml。这里标题包含id,但我想要title-name而不是id。
<?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="report2" language="groovy" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1cea34a0-6df0-4b5c-bdf1-5396f16c69b6">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<queryString language="xPath">
<![CDATA[]]>
</queryString>
<field name="id" class="java.lang.String">
<fieldDescription><![CDATA[/data/record/id]]></fieldDescription>
</field>
<field name="Name-display_name" class="java.lang.String">
<fieldDescription><![CDATA[/data/record/Name-display_name]]> </fieldDescription>
</field>
<field name="State-state_id" class="java.lang.String">
<fieldDescription><![CDATA[/data/record/State-state_id]]></fieldDescription>
</field>
<field name="Title-title" class="java.lang.String">
<fieldDescription><![CDATA[/data/record/Title-title]]> </fieldDescription>
</field>
<variable name="variable1" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch">
<staticText>
<reportElement uuid="cc4e4037-d5b4-4779-9323-35175b9d3996" mode="Transparent" x="19" y="2" width="100" height="20"/>
<textElement/>
<text><![CDATA[/data/record/id]]></text>
</staticText>
<staticText>
<reportElement uuid="7d30c360-83e0-4f99-9f46-7fa942a9fa2c" mode="Transparent" x="142" y="2" width="100" height="20"/>
<textElement/>
<text><![CDATA[/data/record/Name-display_name]]></text>
</staticText>
<staticText>
<reportElement uuid="24237311-4f91-49d9-977d-f5d2d303c46b" x="367" y="2" width="100" height="20"/>
<textElement/>
<text><![CDATA[/data/record/Title-title]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<textField>
<reportElement uuid="80e11f37-ce2b-4c66-a868-30b5695cd5f9" mode="Transparent" x="19" y="11" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="dfa7b27b-44e7-494c-8653-7dab71764c07" mode="Transparent" x="142" y="31" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Name-display_name}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="9d67e3e3-503d-41f5-beb3-d657f8c48306" x="367" y="28" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Title-title}]]></textFieldExpression>
<patternExpression><![CDATA[$F{Title-title}]]></patternExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>