java - displaytag exported excel shows numbers in scientific format -
excel downloaded displaytag export option has field of contact number, , have contact numbers ranging 10 15 digits, (some prefixed +
, others arent), in microsoft excel column contact numbers shows numbers in scientific format example : 9.20e+011
, looking way display (no matter if in text form), idea on issue help.
thanks
often excel tries guess best reprasentation data. , because numbers "huge" uses scientific format. simple solution try put numbers "quotation marks". either directly putting them in quotation marks or converting numbers strings before addressing them in displaytag.
a more complex solution use table decorators export, see tutorial. there can have own implementation of tabledecorator
defined excel export , contact numbers can define use hssfrichtextstring
force excel interpret number not number.
<display:table name="test" export="true" decorator="org.displaytag.sample.modeltabledecorator" > <display:setproperty name="decorator.media.excel" value="org.displaytag.sample.decorators.hssftotalwrapper" /> ... </...>
you can find examples of these decorators in src file displaytag-1.2-src.zip
Comments
Post a Comment