Force Displaytag Export to Text
When I was using displaytag to export to excel, one of my columns contained text which was being recognized as numeric (scientific notation). When googling for a possible solution, seems like a LOT of people have had this problem in various ways (displaytag or otherwise). Thanks to this webpage, my solution was to write the following column decorator:
I have not run into any issues with this approach yet. If you do, I would appreciate a comment back. Thanks again to the guy who posted the hint that I reference previously.
p.s. Someone also suggested that I prepend the text with a unicode non-breaking space (see code following). Visually, it has the desired effect but it also modifies the text in the field so I do not like the solution as well. I just offer that solution to those who might want to use it.
I have not run into any issues with this approach yet. If you do, I would appreciate a comment back. Thanks again to the guy who posted the hint that I reference previously.
p.s. Someone also suggested that I prepend the text with a unicode non-breaking space (see code following). Visually, it has the desired effect but it also modifies the text in the field so I do not like the solution as well. I just offer that solution to those who might want to use it.
Comments