Jasper reports 如何在excel导出中冻结第二张工作表的第一行?

Jasper reports 如何在excel导出中冻结第二张工作表的第一行?,jasper-reports,export-to-excel,Jasper Reports,Export To Excel,我试图冻结jasper报告中excle export第二页的第一行,但它冻结了另一行。在我下面的示例代码中,它冻结了第二张图纸上的前两行,但如果第一张图纸上有更多行,则第二张图纸上冻结的行数将更高。它似乎将第一页的行数“添加”到第二页的顶部,因此,如果第一页上有9行,而我试图冻结第二页上的第一行,它将冻结第二页上的第10行。 这是jasper报告中的错误还是我在这里做错了什么?有人知道如何用另一种方法解决这个问题吗 <?xml version="1.0" encodin

我试图冻结jasper报告中excle export第二页的第一行,但它冻结了另一行。在我下面的示例代码中,它冻结了第二张图纸上的前两行,但如果第一张图纸上有更多行,则第二张图纸上冻结的行数将更高。它似乎将第一页的行数“添加”到第二页的顶部,因此,如果第一页上有9行,而我试图冻结第二页上的第一行,它将冻结第二页上的第10行。 这是jasper报告中的错误还是我在这里做错了什么?有人知道如何用另一种方法解决这个问题吗

<?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="RowBreakTest" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0292da25-2332-41a0-8f81-fcbe04339e99">
    <title>
        <band height="28">
            <staticText>
                <reportElement x="0" y="0" width="280" height="14" />
                <text><![CDATA[This is just the first sheet]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="14" width="280" height="14" />
                <text><![CDATA[]]></text>
            </staticText>
            <staticText>
                <reportElement x="280" y="0" width="270" height="14" />
                <text><![CDATA[]]></text>
            </staticText>
            <staticText>
                <reportElement x="280" y="14" width="270" height="14" />
                <text><![CDATA[]]></text>
            </staticText>
        </band>
    </title>
    <columnHeader>
        <band height="14" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="0" width="280" height="14">
                    <property name="net.sf.jasperreports.export.xls.break.before.row" value="true"/>
                    <property name="net.sf.jasperreports.export.xls.freeze.column.edge" value="Left"/>
                </reportElement>
                <text><![CDATA[header on 2nd sheet]]></text>
            </staticText>
            <staticText>
                <reportElement x="280" y="0" width="270" height="14">
                    <property name="net.sf.jasperreports.export.xls.freeze.row.edge" value="Bottom"/>
                </reportElement>
                <text><![CDATA[more header on 2nd sheet]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="28" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="0" width="280" height="14" />
                <text><![CDATA[data]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="14" width="280" height="14" />
                <text><![CDATA[more data]]></text>
            </staticText>
            <staticText>
                <reportElement x="280" y="0" width="270" height="14" />
                <text><![CDATA[even more data]]></text>
            </staticText>
            <staticText>
                <reportElement x="280" y="14" width="270" height="14"/>
                <text><![CDATA[a lot more data]]></text>
            </staticText>
        </band>
    </detail>
</jasperReport>


是否像示例中那样只有1列?因为我认为您看到的是,您没有定义边(在您的示例中只有一条边),通常,如果在列标题中,您会冻结第一个字段“Left”,最后一个字段“Bottom”。不,原始报告有多个列。我尝试了你的建议,添加了
net.sf.jasperreports.export.xls.freeze.column.edge
属性。它只是冻结了第一列,正如我所期望的那样,但它并没有改变行冻结行为,我仍然在第十行和第一列冻结了工作表,但我只想冻结第一行。将“左”添加到标题中的第一列/字段,然后将“下”添加到标题中的最后一列/字段。这应该冻结BetweeSensory中的所有字段,但这正是我所尝试的,它只是冻结了第一列,但它不会更改冻结的行。这就是方法,如果我没记错的话,Jasper reports也有一个git上的示例,您可以检查。