开发者

how to print dyanmic data on excel sheet

I am using java api to get data from database to excel sheet,In which I have a column name date and the format which will print on the excel is 1-jul-1开发者_开发知识库1 I have done this,Output is same but the main problem is when I click on this column in excel and try to change the format from 1-jul-11 to 7/1/2011 then it not happen, So my main question is how to get data in flexible form on excel so user can change data format according to him.


It seems that in your Excel files, the dates are in fact stored as string. This is probably why changing the format has no effect.

So you need to store the date as a date and possibly assign a date format to the cell as well (since Excel in fact stores dates as numbers).

If you tell us what library you are using to generate the Excel files (e.g. POI) and also post the code that creates the Excel cells containing dates, then I can probably even give you a code sample.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜