getBuiltinFormat had a bug. Nobody used "@" to find it until now (probably because no one knew what it was for). My copy of the code corrects this problem. I'll try to get it committed soon. I'm going to try to clear up a few other things with data formatting (such as documentation).
Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -----Original Message----- From: James Watkin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 08, 2002 3:57 PM To: POI Users List Subject: RE: Feature Request - HSSF Format/Cells/Number/Category/Text Sett ing Shawn, It turns out that getFormat("@") works but getBuiltinFormat("@") doesn't work. Does this sound right to you? Anyway, you seem to have found the solution. Thank you very much. - Jim At 03:12 PM 10/8/2002 -0500, you wrote: >I'm hoping James will tell me if it works and then I'll put it in the >javadocs for HSSFDataFormat (and any place anyone else recommends). I know >I'm being lazy about it but it will would take me time to test it out right >now. If I don't get an answer, I'll test it myself. > >Shawn Laubach >SAIC - Web Developer >B-1B System Support Management Division >OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma >dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 > > >-----Original Message----- >From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, October 08, 2002 3:10 PM >To: 'POI Users List' >Subject: RE: Feature Request - HSSF Format/Cells/Number/Category/Text >Sett ing > > >Can you document that? I had the same question. > >On Tue, 2002-10-08 at 15:03, Laubach Shawn Contr OC-ALC/PSB wrote: > > >From looking at the internals when one sets one as text, the format is >0x31 > > which is a builtin format. Just call >HSSFDataFormat.getBuiltinFormat("@") > > and it should give you the "Text" format. > > > > Shawn Laubach > > SAIC - Web Developer > > B-1B System Support Management Division > > OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma > > dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 > > > > > > -----Original Message----- > > From: James Watkin [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, October 08, 2002 1:56 PM > > To: POI Users List > > Subject: RE: Feature Request - HSSF Format/Cells/Number/Category/Text > > Sett ing > > > > > > When I put a String value in a cell, the resulting value of > > Format/Cells/Number/Category is 'General' within the Excel 2000 GUI, not > > 'Text'. A setting of 'General' results in the bad behavior that I >mentioned > > earlier -- the loss of leading zeros after the text is edited. > > > > Are you really saying that when you set a cell to String, the resulting > > value of Format/Cells/Number/Category is 'Text' within the Excel 2000 GUI > > and not 'General'? I don't seem to be able to achieve that 'Text' setting > > with HSSF. The 'Text' setting seems to be the only way I can get the full > > behavior I'm looking for. > > > > - Jim > > > > At 08:22 AM 10/8/2002 -0500, you wrote: > > >Technically, it does. The does this by setting the type of the cell as > > >text. It doesn't use data formatting in any way. The easiest way to do > > >this is to make sure the value put into the cell is a string and it will > > >remember the text as is. > > > > > >Shawn Laubach > > >SAIC - Web Developer > > >B-1B System Support Management Division > > >OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma > > >dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 > > > > > > > > >-----Original Message----- > > >From: James Watkin [mailto:[EMAIL PROTECTED]] > > >Sent: Monday, October 07, 2002 5:13 PM > > >To: POI Users List > > >Subject: Feature Request - HSSF Format/Cells/Number/Category/Text > > >Setting > > > > > > > > >Is it true that HSSF doesn't support the setting > > >Format/Cells/Number/Category/Text? If so, I'd like to request this >feature. > > >Although I can sort of fake what I need with a custom format, it's not >the > > >same thing and the user might not accept it. The custom format solution > > >only partially solves the fragile spreadsheet problem created by leading > > >zeros in number strings such as serial numbers. > > > > > >A custom format will preserve the 'display' of leading zeros in a number > > >string within a given cell after the cell has been edited. The problem is > > >that the cell value will show up in the editing area without the leading > > >zeros, after the cell has been edited. So while you're editing the cell, > > >whether in place or in the editing area, you won't see the leading zeros. >I > > >think this will be bothersome to my users since we typically handle this > > >now (manually) by setting Format/Cells/Number/Category to 'Text' for such > > >cells so that the leading zeros appear in the editing area. > > > > > >- Jim > > > > > >______________________________ > > >James Watkin > > >The Anderson School at UCLA > > >[EMAIL PROTECTED] > > >Voice: 1-310-825-5030 > > > Fax: 1-310-825-4835 > > >______________________________ > > > > > > > > >-- > > >To unsubscribe, e-mail: ><mailto:[EMAIL PROTECTED]> > > >For additional commands, e-mail: ><mailto:[EMAIL PROTECTED]> > > > > ______________________________ > > James Watkin > > The Anderson School at UCLA > > [EMAIL PROTECTED] > > Voice: 1-310-825-5030 > > Fax: 1-310-825-4835 > > ______________________________ > > > > > > -- > > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> >-- >http://www.superlinksoftware.com - software solutions for business >http://jakarta.apache.org/poi - Excel/Word/OLE 2 Compound Document in >Java >http://krysalis.sourceforge.net/centipede - the best build/project >structure > a guy/gal could have! - Make Ant simple on complex >Projects! >The avalanche has already started. It is too late for the pebbles to >vote. >-Ambassador Kosh > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> ______________________________ James Watkin The Anderson School at UCLA [EMAIL PROTECTED] Voice: 1-310-825-5030 Fax: 1-310-825-4835 ______________________________ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
