You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by thomas908 <an...@hcl.in> on 2007/08/02 14:08:25 UTC

Identifying in bold, italics, underline using POI

We are using Apache POI 3.0 for reading values from an excel sheet.
We have a requirement which requires us to identify if some word in the
excel sheet is in bold or italics or underline.

Can anyone please tell me how to do this?

This is the code I am using

      void func()
      {
      
             try{

                        InputStream fis = new
FileInputStream("C:/bind.xls");;                       
                        POIFSFileSystem fs = new POIFSFileSystem( fis );
                  HSSFWorkbook wb = new HSSFWorkbook(fs);
                  HSSFSheet sheet = wb.getSheetAt(0);
                  HSSFRow row=sheet.getRow(0);
                        HSSFCell cell=row.getCell((short)0);
                        
                        
                        HSSFRichTextString
rts=cell.getRichStringCellValue();
                      System.out.println("----"+rts);
                                          
             }catch(Exception e)
             {
                   e.printStackTrace();
             }
             
      }
The problem is once the value of cell is fetched in the code all formatting
is lost. Please tell me how to find out the formatting.

The value in cell could be something like

"abc pqr xyz"

where pqr is in bold,
abc is in italics

-- 
View this message in context: http://www.nabble.com/Identifying-in-bold%2C-italics%2C-underline-using-POI-tf4205765.html#a11963279
Sent from the POI - User mailing list archive at Nabble.com.


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