Friday, January 13, 2023

how to create a multi/separate worksheet excel - Search Criteria in separate sheet

Just do copy past it will work. Even if not work just keep gap top of the summary band and first element to make sure it consider break.

set below jasper property in top of the report.

<property name="net.sf.jasperreports.export.xls.sheet.names.all" value="First 

sheet/Second sheet/Third sheet" />

Add break to see that part in separate worksheet. 

<summary>
    <band height="110">
        <printWhenExpression><![CDATA[$V{MAIN_REPORT_TABLE1_COUNT}>=1]]></printWhenExpression>
<textField>
        <reportElement X="0" y="0" width="1000" height="40" >
                <property name="net.sf.jasperreports.export.xls.break.before.row" value="true"/>
 </reportElement>
<textElement> <font size="24" isBold="true"/></textElement> 
<textFieldExpression><![CDATA["Search Criteria"]]></textFieldExpression>
</textField>
</band>
</summary>    

https://stackoverflow.com/questions/34808741/how-to-export-to-multiple-sheets-in-excel-from-jasper-report#:~:text=sheet%3D%22true%22%20%2C%20created,master%20report%2CAnd%20this%20worked%20!