Jasper 与 odoo 显示 M2O 和 O2M 领域

问题描述 投票:0回答:1

我正在尝试使用 XML 数据源在 iReport 中与 odoo 集成创建一个报告。现在的问题是我得到 M2O 和 O2M 字段的空值。

我应该如何获取报告中这些字段的值? 预先感谢。

这是我报告的jrxml。这里的标题包含 id,但我想要标题名称而不是它的 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>

jasper-reports odoo jasperserver odoo-8
1个回答
0
投票

请问您找到这个问题的解决方案了吗? ?

© www.soinside.com 2019 - 2024. All rights reserved.