JExcelApi problem z pobieraniem Formuły

0

Witam

        try {
            Workbook workbook = Workbook.getWorkbook(new File(path + fileName));
            
            Sheet sheet = workbook.getSheet(0);
            
            Cell cell = sheet.getCell(0, 1);
            int i = 1;
            
            while( cell.getContents().compareTo("") != 0 ) {
                /*if( cell.getContents().compareTo(valueToSearch) == 0 ) {
                    
                    sheet.addCell( new Label( positionToAdd, i, valueToAdd ) );
                    
                    copy.write();
                    copy.close();
                    return true;
                }*/
                String txt = "";
                
                for( int j = 0; j < colName.length; j++ ) {
                    txt += sheet.getCell( j, i );
                }
                
                if( comp( txt, keyWords, 0 ) ) {
                    FormulaCell c = (FormulaCell) sheet.getCell(0, 1);
                    System.out.println( c.getFormula() );
                    listOf.add( sheet.getCell( 10, i).getContents() );
                }
                
                i++;
                cell = sheet.getCell(0, i);
            }    

Mam taki kod i nie moge wyciągnać formuły :( Caly czas pisze

java.lang.ClassCastException: jxl.read.biff.LabelSSTRecord cannot be cast to jxl.write.Formula

Moze wie ktos jak rozwiązać ten problem ?

Dziekuje

0

Chodzi o to, że klasa jxl.read.biff.LabelSSTRecord, nie może być rzutowana do klasy jxl.write.Formula.

1 użytkowników online, w tym zalogowanych: 0, gości: 1