Hello support,
I’m currently working with JasperReport 6.20 to generate reports. Additionally, I’m using Aspose version 23.9 along with the Aspose.Words.jasperreports library (version 7.8.0-8.0.0) for report exporting to Word format.
The problem I’m facing is that when I export my report to Word, the header and footer content is not retained in the Word document, even though they appear correctly in the Word file. This issue is evident in the attached screenshot.
I would appreciate any assistance in resolving this matter.
you can fin attached the screenshot .
Best regards.
Here’s a rephrased version of your provided case for better understanding:
<?xml version="1.0" encoding="UTF-8"?>
<pageHeader>
<band height="99" splitType="Stretch">
<subreport isUsingCache="true" runToBottom="false">
<reportElement x="10" y="20" width="500" height="60" forecolor="#FFFFFF" uuid="0886ac7a-b476-4363-8874-bd329f0eac21" />
<subreportParameter name="mapEntite">
<subreportParameterExpression><![CDATA[$P{mapEntite}]]></subreportParameterExpression>
</subreportParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{datasourceEntete}.getData())]]></dataSourceExpression>
<subreportExpression><![CDATA[$P{patronEntete}]]></subreportExpression>
</subreport>
</band>
</pageHeader>
In this scenario, the issue is that the subreport is visible, but it does not appear in the header section of the Word document.
If a simple textField
appears correctly in the header while a subreport
does not, there might be a compatibility or configuration issue specific to how subreports are handled in the context of exporting to Word documents.
<?xml version="1.0" encoding="UTF-8"?>
<pageHeader>
<band height="99" splitType="Stretch">
<!-- Using a textField instead of a subreport -->
<textField>
<reportElement x="10" y="20" width="500" height="60" forecolor="#FFFFFF" uuid="0886ac7a-b476-4363-8874-bd329f0eac21" />
<textFieldExpression><![CDATA[$P{patronEntete}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
In this example, I’ve replaced the subreport
with a textField
to see if it resolves the issue. If the textField
works correctly in the header, it suggests that the problem might be related to how subreports are handled or configured during the export to Word. You may need to review the compatibility of subreports with Word export or check if there are any specific settings or configurations required for subreports in this context.