My requirement is to keep the Date filed in Excel which should not change because of its locale (US/UK)
So i am writing the Date as text field, yet when i click the excel to edit the Date, the format of the cell changes to Numeric hence to date then onwards.
I am looking for some thing like cellStyle.setDataFormat(format.getFormat("@")); which is in apache POI.
Kindly help
2 Answers:
Posted on April 13, 2018 at 2:29pm
Try these Config references. I believe it should fix your issue.
http://jasperreports.sourceforge.net/sample.reference/xlsfeatures/index....
<textField pattern="EEE, MMM d, yyyy"> <reportElement style="Sans_Bold" mode="Opaque" x="0" y="30" width="515" height="30" forecolor="#000000"> <property name="net.sf.jasperreports.export.xls.pattern" value="ddd, mmm d, yyyy"/> </reportElement> ... </textField>
In this case the EEE, MMM d, yyyy pattern, completely valid in Java but generating unreadable content for Excel, is replaced with the equivalent ddd, mmm d, yyyy pattern when exporting report to Excel.