poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18954] - Formulas inside If-statement are not recognized.
Date Fri, 11 Apr 2003 15:39:18 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18954>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18954

Formulas inside If-statement are not recognized.





------- Additional Comments From fw.wolter@siemens.com  2003-04-11 15:39 -------
Hello Danny,

thanks for the fast reply

Frank Wolter

here is my (stripped) code:


  public boolean parseSheet(String sheetname ) 
  {
     m_SheetNameExcel = sheetname;
     m_SheetNameDisplay = m_SheetNameExcel;
     m_visibleRange = null;
     m_cellsWithSheetReferences.clear();
     HSSFCellStyle c_style;
     int col_n = 0;
     int row_n = 0;
     HSSFRow phyRow = null;
     HSSFSheet sheet    = m_workbook.getSheet(sheetname);
     HSSFFont cellfont  = m_workbook.getFontAt((short)0);

     logger.debug( "ENTER parseSheet(sheetname=" + sheetname + ")" );


     int rowNum = sheet.getLastRowNum();

     Iterator rows = sheet.rowIterator();
     HSSFRow row;
     while( rows.hasNext()) 
     {
            row = (HSSFRow) rows.next();
            row_n = row.getRowNum();

            // Iterate over each cell in the row and print out the cell's 
content
            Iterator cells = row.cellIterator();

            short fontindex;
            short c_bcolor;
            short c_fcolor;
            HSSFCell cell;

            while( cells.hasNext()) 
            {
                cell = (HSSFCell) cells.next();
                col_n = cell.getCellNum();
                logger.info("Working on cell(row="+ (row_n) + ", col=" + 
(col_n) + ")");

                try
                {
                    c_style = cell.getCellStyle();

                    switch ( cell.getCellType() ) {
                        case HSSFCell.CELL_TYPE_NUMERIC:

                            break;
                        case HSSFCell.CELL_TYPE_STRING:
                            break;
                        case HSSFCell.CELL_TYPE_BLANK:
                            break;
                        case HSSFCell.CELL_TYPE_FORMULA:
// HERE THE PROBLEM OCCURS:
                            logger.debug("Formula: " + cell.getCellFormula());
                            break;
                        default:
                            logger.error( "unsuported cell type in sheet'" + 
sheetname + "', row=" +  row_n + ", col=" +  col_n);

                            break;
                    }
                }
                catch ( Exception e )
                {
                    logger.error("Exception for cell("+ row_n + ", " + col_n 
+ ") Exception:" + e.toString());
                    e.printStackTrace();

                } /* end catch() */  

            } //end while

        } //end first while

Mime
View raw message