0
我需要一個多選參數從數據庫中獲取值。我認爲級聯參數是正確的事情,讓這個工作?jasperreports級聯參數不起作用
我做了一個簡單的報告,用jasperstudio 5.6.2測試級聯參數,但參數甚至是空的。沒有要選擇的數據。
這裏是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="Blank_A4_Landscape" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="e87dae0c-1038-441c-aa84-42d2224932d6">
<parameter name="empl" class="java.util.Collection">
</parameter>
<queryString language="SQL">
<![CDATA[Select concat(last_name, ', ', first_name) AS name
FROM users
WHERE $X{IN, name, empl}
ORDER BY last_name, first_name]]>
</queryString>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="id" class="java.lang.Integer"/>
<columnHeader>
<band height="33" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="100" height="20" uuid="046a2154-24a7-4355-8677-3b300418f6ec"/>
<text><![CDATA[Name]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="29" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="31dbb8be-03da-418b-8f93-cc86abdd7e03"/>
<textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="19" splitType="Stretch"/>
</columnFooter>
</jasperReport>
有什麼不對呢? 我有一個級聯的示例報告,但沒有什麼不同於這裏