poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andriy.zhu...@bayerbbs.com
Subject Antwort: Issue with regard to Format-Masks
Date Fri, 28 May 2004 14:49:21 GMT




Hi Yogesh,

I make it this way :

org.dom4j.Element e = cellstyleelement.element("xlformat");

if (e != null) {
      if (e.attributeValue("format") != null) {
            HSSFDataFormat DataFormat = wb.createDataFormat();
            cs.setDataFormat(DataFormat.getFormat(e.attributeValue("format")));
       } else {
            cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0"));
       }
}

Hope it helps.

Regards,
Andrew



|---------+--------------------------->
|         |                           |
|         |                           |
|         |                           |
|         |                           |
|         |                           |
|         |                           |
|         |  "Yogesh Mahadeviah"      |
|         |  <yogi_m@hotmail.com>     |
|         |  Received :  28.05.2004   |
|         |  16:42                    |
|         |  Bitte antworten an "POI  |
|         |  Users List"              |
|         |                           |
|---------+--------------------------->
  >-------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                                        |
  |                                                                                      
                                        |
  |        An:      <poi-user@jakarta.apache.org>                                  
                                              |
  |        Kopie:                                                                        
                                        |
  |        Thema:   Issue with regard to Format-Masks                                    
                                        |
  >-------------------------------------------------------------------------------------------------------------------------------|




Hi..
I am working with Dates and i have a format-mask that needs to be applied.
The format mask being
'mm-dd-yyyy ( with the option of time)'. The built in format-masks set for
HSSFDataFormat does not
contain this mask that I need to use while generating spreadsheets.
Would like to know if there is a way to add new Format-Masks and then use
it, in a way similar to
building the custom palette.

thank you
Yogesh

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Mime
View raw message