I have to create a report in excel using jsp.Which has been done by setting the content type as "application\vnd.ms-excel" . Report comes out fine, but a field which has no. in it comes like "9.19812E+11" the actual data once u double click on the cell comes as "919811911126" . To correct this we have to format the cell by rt clicking(cell formatting) on it and making it no. with 0 decimals.
I am creating this excel file using <table></table> in jsp.Data gets populated to the cells.
Can we do this formatting at time of report creation on jsp.
On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it - please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.
As to your question, Excel will treat anything that looks like a number as a number -even if it is not- and handle it as it sees fit, which by default means scientific nmber format. I think -since there is no way to specify formatting in CSV or HTML- there is no way to prevent this. Do you have a particular reason why you're not generating an actual XLS file, where you can control the formatting of the field? An API like POI is not hard to use. [ April 25, 2006: Message edited by: Ulf Dittmer ]
Ping & DNS - updated with new look and Ping home screen widget