我有一个包含一列的表,我希望它使用报告的数据源。我如何实现这一目标?这是我试过的。
<detail>
<band height="450" splitType="Prevent">
<componentElement>
<reportElement x="50" y="20" width="200" height="200" uuid="02138e52-a5eb-4582-8dc4-cbdfa329fd89"/>
<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="Dataset1" uuid="bd2fa891-6406-4354-99fd-98ad798da835">
<dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}.cloneDataSource()]]></dataSourceExpression>
</datasetRun>
<jr:column width="200" uuid="ae8c0727-017e-4a01-ad87-e0899c41ce54">
<jr:columnHeader style="Table 3_CH" height="30">
<staticText>
<reportElement x="0" y="0" width="200" height="30" uuid="77f26a91-9eae-4ce7-abef-5a582db5611b"/>
<text><![CDATA[leitung]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table 3_TD" height="30">
<textField>
<reportElement x="0" y="0" width="200" height="30" uuid="e70f7a65-32f8-448d-80c6-62d63a3d8a96"/>
<textFieldExpression><![CDATA[$F{leitung}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>