Why are you rendering a JSP as an excel file?? I don't know how you are actually doing it, but once I needed to create excel files and I created then using Apache POI library for that. Since it is not clear to me how you are rendering your JSP as an excel file, I wonder how you have a number like 00010345 in java. If you store that value in a numeric type, it will automatically remove the leading zeros. So if you have that value as a String in java, maybe you should render it as a string in your excel file...
If i have a number as 00010345 it should be displayed as is when exported to an xls. Currently the number is displayed as, 10345 (Without the zeros)
Excel can do this (as can the libraries used for creating proper XLS files - mainly Apache POI and jExcelApi). But since you mention JSPs, I'm pretty sure that you're not creating an XLS file, but rather some text file that you're trying to have Excel open by setting the content type; is that correct? If so, then this can't be done.
I 'm pretty sure that you're not creating an XLS file, but rather some text file that you're trying to have Excel open by setting the content type; is that correct?
Yes, thats exactly what i have done. I am not creating a binary file and data writing into it.
I tried to display the field as a formula field[by prefixing and'=' sign], and tried appending a space [ ] to convert it to string format. But this is not how they want it to be done. please let me know if you are aware of any other workaround.
Joined: Mar 22, 2005
Well, it would be useful to know how "they" want "it" to be done, and what "it" actually is. As I said, the original problem requires creating (and streaming) an actual XLS file, and that can't be done in a JSP - you need to use a servlet.