使用交叉表时如何设置动态主报表宽度?
How to set dynamic main report width when using crosstab?
我正在制作一个仅显示具有动态记录计数的交叉表的报告。
这意味着我将需要一个没有固定宽度的主报表。到目前为止,我似乎没有一个干净的方法(我只是把宽度弄得超大,比如超过 10,000)。
是否有某种针对宽度的构建关键字,例如 DYNAMIC
或 hasNoWidth
,以便主报表的宽度将基于交叉表的宽度。
对于单个交叉表,使用属性 ignoreWidth="true"
If this attribute is set to true, the crosstab will expand towards the
right (or towards the left if the crosstab direction is RTL) as long
as it needs to. This would result in crosstab cells being rendered
over the page boundary; such elements will be exported by certain
grid-based exporters such as the HTML or XLS ones, but will not be
visible in export formats that observe the page width, such as the PDF
exporter.
注意:这如何用于动态宽度可能为 HTML 的导出,XLS 但不适用于动态宽度不可能为 PDF 的导出。
例子
<crosstab ignoreWidth="true">
....
</crosstab>
如果您喜欢 所有 交叉表在 ignoreWidth
的报告中,您还可以设置 属性 net.sf.jasperreports.crosstab.ignore.width
例子
<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" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="48809477-2290-4dda-a6f9-5d348ff0b70b">
<property name="net.sf.jasperreports.crosstab.ignore.width" value="true"/>
....
</jasperReport>
我正在制作一个仅显示具有动态记录计数的交叉表的报告。
这意味着我将需要一个没有固定宽度的主报表。到目前为止,我似乎没有一个干净的方法(我只是把宽度弄得超大,比如超过 10,000)。
是否有某种针对宽度的构建关键字,例如 DYNAMIC
或 hasNoWidth
,以便主报表的宽度将基于交叉表的宽度。
对于单个交叉表,使用属性 ignoreWidth="true"
If this attribute is set to true, the crosstab will expand towards the right (or towards the left if the crosstab direction is RTL) as long as it needs to. This would result in crosstab cells being rendered over the page boundary; such elements will be exported by certain grid-based exporters such as the HTML or XLS ones, but will not be visible in export formats that observe the page width, such as the PDF exporter.
注意:这如何用于动态宽度可能为 HTML 的导出,XLS 但不适用于动态宽度不可能为 PDF 的导出。
例子
<crosstab ignoreWidth="true">
....
</crosstab>
如果您喜欢 所有 交叉表在 ignoreWidth
的报告中,您还可以设置 属性 net.sf.jasperreports.crosstab.ignore.width
例子
<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" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="48809477-2290-4dda-a6f9-5d348ff0b70b">
<property name="net.sf.jasperreports.crosstab.ignore.width" value="true"/>
....
</jasperReport>