How to convert Date as String in Excel and Keep the format unchanged

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

 

saranya.kumaar's picture
Joined: Apr 13 2018 - 5:20am
Last seen: 4 years 11 months ago

2 Answers:

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.

reportdev's picture
10554
Joined: Oct 12 2015 - 12:05pm
Last seen: 9 months 2 weeks ago

Thanks for your reply.  but still i am facing same issue. ..please suggest if you have any other reference.

saranya.kumaar's picture
Joined: Apr 13 2018 - 5:20am
Last seen: 4 years 11 months ago
Feedback
randomness