patricia.williams Posted January 26, 2017 Posted January 26, 2017 when you open the spreadsheet, its name is the sheet name. I'd like to set the sheet name to the date of creation.
hozawa Posted January 26, 2017 Posted January 26, 2017 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-names
lbor Posted October 12, 2017 Posted October 12, 2017 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now