Examples of XSSFRow


Examples of org.apache.poi.xssf.usermodel.XSSFRow

            XSSFSheet sheet = wb.getSheetAt(sheetNum);
            if (sheet != null)
            {
               for (int rowNum = sheet.getFirstRowNum(); rowNum <= sheet.getLastRowNum(); rowNum++)
               {
                  XSSFRow row = sheet.getRow(rowNum);

                  if (row != null)
                  {
                     int lastcell = row.getLastCellNum();
                     for (int k = 0; k < lastcell; k++)
                     {
                        XSSFCell cell = row.getCell(k);
                        if (cell != null)
                        {
                           switch (cell.getCellType())
                           {
                              case XSSFCell.CELL_TYPE_NUMERIC : {
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

       
        try {
           
            XSSFWorkbook workbook = new XSSFWorkbook(inputFile);
            XSSFSheet sheet = workbook.getSheetAt( 0 );
            XSSFRow row = sheet.getRow(0);
           
            Iterator<Cell> cellIt = row.cellIterator();
           
            fields = new LinkedHashMap();
           
            while( cellIt.hasNext() ) {
                Cell currCell = cellIt.next();
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

            XSSFSheet sheet = wb.getSheetAt(sheetNum);
            if (sheet != null)
            {
               for (int rowNum = sheet.getFirstRowNum(); rowNum <= sheet.getLastRowNum(); rowNum++)
               {
                  XSSFRow row = sheet.getRow(rowNum);

                  if (row != null)
                  {
                     int lastcell = row.getLastCellNum();
                     for (int k = 0; k < lastcell; k++)
                     {
                        XSSFCell cell = row.getCell(k);
                        if (cell != null)
                        {
                           switch (cell.getCellType())
                           {
                              case XSSFCell.CELL_TYPE_NUMERIC : {
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

        }
    }

    private void updateSheetFormulas(XSSFSheet sh, FormulaShifter shifter) {
        for (Row r : sh) {
            XSSFRow row = (XSSFRow) r;
            updateRowFormulas(row, shifter);
        }
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

                    startRow +=1;

                    int endRow = table.getEndCellReference().getRow();

                    for(int i = startRow; i<= endRow; i++) {
                        XSSFRow row = sheet.getRow(i);

                        Node tableRootNode = getNodeByXPath(table.getCommonXpath(),doc.getFirstChild(),doc,true);

                        short startColumnIndex = table.getStartCellReference().getCol();
                        for(int j = startColumnIndex; j<= table.getEndCellReference().getCol();j++) {
                            XSSFCell cell = row.getCell(j);
                            if (cell!=null) {
                                XSSFXmlColumnPr pointer = tableColumns.get(j-startColumnIndex);
                                String localXPath = pointer.getLocalXPath();
                                Node currentNode = getNodeByXPath(localXPath,tableRootNode,doc,false);
                                STXmlDataType.Enum dataType = pointer.getXmlDataType();
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

                    String nodeXPath = commonXPath + "[" + (i + 1) + "]" + localXPath;

                    // TODO: convert the data to the cell format
                    String value = (String) xpath.evaluate(nodeXPath, result.item(i), XPathConstants.STRING);
                    logger.log(POILogger.DEBUG, "Extracting with xpath " + nodeXPath + " : value is '" + value + "'");
                    XSSFRow row = table.getXSSFSheet().getRow(rowId);
                    if (row == null) {
                        row = table.getXSSFSheet().createRow(rowId);
                    }

                    XSSFCell cell = row.getCell(columnId);
                    if (cell == null) {
                        cell = row.createCell(columnId);
                    }
                    logger.log(POILogger.DEBUG, "Setting '" + value + "' to cell " + cell.getColumnIndex() + "-" + cell.getRowIndex() + " in sheet "
                                                    + table.getXSSFSheet().getSheetName());
                    cell.setCellValue(value.trim());
                }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

                    String nodeXPath = commonXPath + "[" + (i + 1) + "]" + localXPath;

                    // TODO: convert the data to the cell format
                    String value = (String) xpath.evaluate(nodeXPath, result.item(i), XPathConstants.STRING);
                    logger.log(POILogger.DEBUG, "Extracting with xpath " + nodeXPath + " : value is '" + value + "'");
                    XSSFRow row = table.getXSSFSheet().getRow(rowId);
                    if (row == null) {
                        row = table.getXSSFSheet().createRow(rowId);
                    }

                    XSSFCell cell = row.getCell(columnId);
                    if (cell == null) {
                        cell = row.createCell(columnId);
                    }
                    logger.log(POILogger.DEBUG, "Setting '" + value + "' to cell " + cell.getColumnIndex() + "-" + cell.getRowIndex() + " in sheet "
                                                    + table.getXSSFSheet().getSheetName());
                    cell.setCellValue(value.trim());
                }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

                    startRow +=1;

                    int endRow = table.getEndCellReference().getRow();

                    for(int i = startRow; i<= endRow; i++) {
                        XSSFRow row = sheet.getRow(i);

                        Node tableRootNode = getNodeByXPath(table.getCommonXpath(),doc.getFirstChild(),doc,true);

                        short startColumnIndex = table.getStartCellReference().getCol();
                        for(int j = startColumnIndex; j<= table.getEndCellReference().getCol();j++) {
                            XSSFCell cell = row.getCell(j);
                            if (cell!=null) {
                                XSSFXmlColumnPr pointer = tableColumns.get(j-startColumnIndex);
                                String localXPath = pointer.getLocalXPath();
                                Node currentNode = getNodeByXPath(localXPath,tableRootNode,doc,false);
                                STXmlDataType.Enum dataType = pointer.getXmlDataType();
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

                    startRow +=1;

                    int endRow = table.getEndCellReference().getRow();

                    for(int i = startRow; i<= endRow; i++) {
                        XSSFRow row = sheet.getRow(i);

                        Node tableRootNode = getNodeByXPath(table.getCommonXpath(),doc.getFirstChild(),doc,true);

                        short startColumnIndex = table.getStartCellReference().getCol();
                        for(int j = startColumnIndex; j<= table.getEndCellReference().getCol();j++) {
                            XSSFCell cell = row.getCell(j);
                            if (cell!=null) {
                                XSSFXmlColumnPr pointer = tableColumns.get(j-startColumnIndex);
                                String localXPath = pointer.getLocalXPath();
                                Node currentNode = getNodeByXPath(localXPath,tableRootNode,doc,false);
                                STXmlDataType.Enum dataType = pointer.getXmlDataType();
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFRow

    
     importer.importFromXML(testXML);
    
     XSSFSheet sheet=wb.getSheetAt(0);
    
     XSSFRow row = sheet.getRow(0);
     assertTrue(row.getCell(0).getStringCellValue().equals(name));
     assertTrue(row.getCell(1).getStringCellValue().equals(teacher));
     assertTrue(row.getCell(2).getStringCellValue().equals(tutor));
     assertTrue(row.getCell(3).getStringCellValue().equals(cdl));
     assertTrue(row.getCell(4).getStringCellValue().equals(duration));
     assertTrue(row.getCell(5).getStringCellValue().equals(topic));
     assertTrue(row.getCell(6).getStringCellValue().equals(project));
     assertTrue(row.getCell(7).getStringCellValue().equals(credits))
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.