我想通过grails jasper插件使用添加到JasperReports 3.7.2的新表组件。我发现这个新组件对于生成表格很有用。如何使用grails jasper插件添加到JasperReports 3.7.2中的表组件?
我已经定义了表数据集1和一些字段(例如:$ F {name}),问题是,我的所有字段值都是空值。我也定义了字段(不附带表格),并且我得到了值。
这里是我的表码:
<subDataset name="Table Dataset 1">
<field name="name" class="java.lang.String"/>
<field name="signal" class="java.lang.Double"/>
...
</subDataset>
<componentElement>
<reportElement key="table" style="table" x="0" y="0" width="802" height="50"/>
<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="Table Dataset 1">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource(1)]]></dataSourceExpression>
</datasetRun>
<jr:column width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement/>
<text><![CDATA[Name]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
...
我想,我的问题是由于这部分(我使用JREmptyDataSource):
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource(1)]]></dataSourceExpression>
但我怎么可以让我<MODEL_DATA>
与表格组件?
(例如:链(控制器: '碧玉',动作: '索引',型号:[数据:<MODEL_DATA>
],则params:PARAMS))
如果您希望使用辅助数据集,该怎么办? – monksy 2011-03-10 21:14:10