[#4744] - JRXlsxExporter fails to change default sheet names

Category:
Bug report
Priority:
Normal
Status:
Closed
Project: Severity:
Major
Resolution:
Fixed
Component: Reproducibility:
Always
Assigned to:
0

Even if I set JRXlsAbstractExporterParameter.SHEET_NAMES for JRXlsxExporter, the sheet names don't change.
I think it is because of XlsxWorkbookHelper witch generates the sheet names in the form Sheet1, Sheet2.

tudor_secrieriu's picture
Joined: Jun 11 2010 - 2:56am
Last seen: 4 years 4 months ago

6 Comments:

#1

I am using net.sf.jasperreports.export.xls.sheet.names.{arbitrary_name} which is working for both xls and xlsx. But as my requirement is for dynamic names i am using a line element and using this property net.sf.jasperreports.export.xls.sheet.name. This is working for xls but this one is not working for xlsx.I am using jasperserver 4.5 and ireport 4.5 . What i am supposed to do for giving dynamic name of sheets in xlsx

#2

any idea when net.sf.jasperreports.export.xls.sheet.name(for dynamic sheet names) for XLSX issue was fixed.I am trying in 4.5 it's not working.I found it working in 5.0 .I have gone through the fixes for various version but didn't find this issue.
What am i supposed do for 4.5.

AttachmentSize
report1.jrxml3.1 KB
#3

Hi,

The property was initially designed for the older XLS format. It was enabled for the XLSX output format in JR 4.6.0. If possible, try to upgrade to JR 4.6.0 or newer.
With JR 4.5.0 you can use the JRXlsAbstractExporterParameter.SHEET_NAMES parameter instead.

#4

Hi shertage
Thanks for the reply .However i am using jasperserver and ireport . i have gone through ultimate guide which says we cannot set the export parameters in scriplets. So i guess we can not set the export property using the ireport properties.am i right? Thanks once again for the reply.

#5

Hi,
My apologies for the delayed answer, I wasn't notified about your question.
The answer is: export parameters cannot be set in scriptlets, indeed. For JR 4.5.0 the SHEET_NAMES parameter has to be set at export time. Another possibility is to write a custom exporter that extends one of the existing Excel exporters and collects dynamic sheet name properties at element level.
The third possibility (most recommended) would be to upgrade to JR 4.6.0 or newer.

Best regards,
sanda

#6

Thanks for the reply.

Chandra

Feedback
randomness