?
Solved

Not able to display the date formate while passing through java

Posted on 2010-01-07
2
Medium Priority
?
165 Views
Last Modified: 2013-11-23
I am passing date string to excel. my date string formate is  (MMM dd,yyy) i.e NOV 11, 2009
i want to display the date  in excel in the same formate as it is being sent. But in the excel i am getting date in different formate  i.e 11-Nov-09.
i am using response.setContentType("application/vnd.ms-excel"); to convert the data from java to excel.
Can anybody help me
0
Comment
Question by:kbb1
2 Comments
 
LVL 29

Expert Comment

by:leonstryker
ID: 26206857
I would say pass it as either text or run some code to apply the format after the data is transferred.

Leon
0
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 2000 total points
ID: 26206954
@kbb1: which package are you using for creating the excel sheet through Java.
If it is Apache POI then you can set a specific date format by using
cell.getCellStyle().setDataFormat();

Please go through this documentation
http://poi.apache.org/spreadsheet/converting.html
http://poi.apache.org/spreadsheet/how-to.html
http://onjava.com/pub/a/onjava/2003/04/16/poi_excel.html
http://www.javaworld.com/javaworld/jw-03-2004/jw-0322-poi.html
http://rgagnon.com/javadetails/java-0516.html

Thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month17 days, 5 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question