when you open the spreadsheet, its name is the sheet name. I'd like to set the sheet name to the date of creation.
2 Answers:
Sheet name can be set type setting them in property "net.sf.jasperreports.export.xls.sheet.name". Following page shows how to set it dynamically:
http://community.jaspersoft.com/wiki/excel-export-dynamically-set-sheet-...
That link hints that you can use net.sf.jasperreports.export.xls.sheet.name to obtain that, but does not really explain how.
A little trial&error testing in Jasper Studio 6.4.0.final using a simple report with column header and detail band, revealed that JS was very picky about where to place it. I could only get it to work if I placed it inside a reportElement:
<detail>
<band height="14" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="70" height="14" uuid="e0777908-52d5-4c52-8fb3-fcb3c31633bb">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<propertyExpression name="net.sf.jasperreports.export.xls.sheet.name"><![CDATA[$V{SheetDetail}]]></propertyExpression>
</reportElement>
<textFieldExpression><![CDATA[$F{REP_AAR}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="70" y="0" width="85" height="14" uuid="b0d57d3b-0c00-4eb2-a106-d845732c8015"/>
$V{SheetDetail} is just a variable I created to hold the name of the sheet. It could also be a field.
Furthermore, it did not matter in which field i placed the "sheet name", so I just placed it in the first field.