Example usage for org.apache.poi.hssf.usermodel HSSFRow getCell

List of usage examples for org.apache.poi.hssf.usermodel HSSFRow getCell

Introduction

In this page you can find the example usage for org.apache.poi.hssf.usermodel HSSFRow getCell.

Prototype

@Override
public HSSFCell getCell(int cellnum) 

Source Link

Document

Get the hssfcell representing a given column (logical cell) 0-based.

Usage

From source file:com.synct.report.bm10101_4.java

public void printPageBody(int k, String[] data1, int rowno) throws IOException {
    try {/*from  w w w . ja v a 2  s. co m*/
        //[J
        HSSFRow row = sheet.getRow(0);
        HSSFCell cell1 = row.getCell((short) (20));
        setBig5CellValue(data1[0], cell1); //U1 LICENSE_DESC

        row = sheet.getRow(1);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[1], cell1); //G2 P01_NAME

        row = sheet.getRow(2);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[2], cell1); //G3 ADDR

        row = sheet.getRow(3);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[3], cell1); //G4 LANNO

        row = sheet.getRow(4);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[4], cell1); //G5 ADDR

        row = sheet.getRow(5);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[5], cell1); //G6 USE_CATEGORY_CODE_DESC

        row = sheet.getRow(6);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[6], cell1); //G7 CHWANG DONG

        row = sheet.getRow(10);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[7], cell1); //G8 BUILDING_CATEGORY

        //*****************************************************************************
        /*
        0 1 2 3 4 5 6 7 8 910111213141516171819202122232425 6 7 8 930 1 2 3 4 5 
        A B C D E F G H I J K L M N O P Q R S T U V W X Y ZAAABACADAEAFAGAHAIAJ        
        */
        row = sheet.getRow(8);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[8], cell1); //G9 STC1     i

        row = sheet.getRow(9);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[9], cell1); //G10 AREA1

        row = sheet.getRow(10);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[10], cell1); //G11 HEIGHT1

        row = sheet.getRow(8);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[11], cell1); //L9 STC1  ii

        row = sheet.getRow(9);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[12], cell1); //L10 AREA1

        row = sheet.getRow(10);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[13], cell1); //L11 HEIGHT1

        row = sheet.getRow(8);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[14], cell1); //Q9 STC1 iii

        row = sheet.getRow(9);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[15], cell1); //Q10 AREA1

        row = sheet.getRow(10);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[16], cell1); //Q11 HEIGHT1

        row = sheet.getRow(8);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[17], cell1); //V9 STC1 iv

        row = sheet.getRow(9);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[18], cell1); //V10 AREA1

        row = sheet.getRow(10);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[19], cell1); //V11 HEIGHT1

        row = sheet.getRow(8);
        cell1 = row.getCell((short) (26));
        setBig5CellValue(data1[20], cell1); //AA9 STC1 v

        row = sheet.getRow(9);
        cell1 = row.getCell((short) (26));
        setBig5CellValue(data1[21], cell1); //AA10 AREA1

        row = sheet.getRow(10);
        cell1 = row.getCell((short) (26));
        setBig5CellValue(data1[22], cell1); //AA11 HEIGHT1

        row = sheet.getRow(8);
        cell1 = row.getCell((short) (31));
        setBig5CellValue(data1[23], cell1); //AF9 STC1 vi

        row = sheet.getRow(9);
        cell1 = row.getCell((short) (31));
        setBig5CellValue(data1[24], cell1); //AF10 AREA1

        row = sheet.getRow(10);
        cell1 = row.getCell((short) (31));
        setBig5CellValue(data1[25], cell1); //AF11 HEIGHT1

        row = sheet.getRow(11);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[26], cell1); //G12 STC1 vii

        row = sheet.getRow(12);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[27], cell1); //G13 AREA1

        row = sheet.getRow(13);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[28], cell1); //G14 HEIGHT1

        row = sheet.getRow(11);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[29], cell1); //L12 STC1 viii

        row = sheet.getRow(12);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[30], cell1); //L13 AREA1

        row = sheet.getRow(13);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[31], cell1); //L14 HEIGHT1

        row = sheet.getRow(11);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[32], cell1); //Q12 STC1 ix

        row = sheet.getRow(12);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[33], cell1); //Q13 AREA1

        row = sheet.getRow(13);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[34], cell1); //Q14 HEIGHT1

        row = sheet.getRow(11);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[35], cell1); //V12 STC1 x

        row = sheet.getRow(12);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[36], cell1); //V13 AREA1

        row = sheet.getRow(13);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[37], cell1); //V14 HEIGHT1

        row = sheet.getRow(14);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[38], cell1); //G15 OTHERS_NAME

        row = sheet.getRow(15);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[39], cell1); //G16 USE LICE_DESC

        row = sheet.getRow(16);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[40], cell1); //G17 PRICE

        row = sheet.getRow(17);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[41], cell1); //G18 APPROVE_LICE_DATE

        row = sheet.getRow(17);
        cell1 = row.getCell((short) (26));
        setBig5CellValue(data1[42], cell1); //AA18 RECEIVE_LICE_DATE

        row = sheet.getRow(20);
        cell1 = row.getCell((short) (1));
        setBig5CellValue("W    " + data1[1], cell1); //B21 P01_NAME

        row = sheet.getRow(27);
        cell1 = row.getCell((short) (0));
        setBig5CellValue(data1[43], cell1); //A28 IDENTIFY_LICE_DATE

    } catch (Exception e) {
        System.err.println("bm10101_4:printPageBody error is " + e);
    }

}

From source file:com.synct.report.bm10101_4.java

public void printPageBody1(int k, String[] data1, int rowno) throws IOException {
    try {/*www .  j a va 2 s .c om*/

        HSSFRow row = sheet1.getRow(0);
        HSSFCell cell1 = row.getCell((short) (0));
        int j = 0;

        for (int i = 0; i < data_other.size(); i++) {
            row = sheet1.getRow(i); //1+i
            cell1 = row.getCell((short) (0));
            //setBig5CellValue(data_other[i],cell1); 
            setBig5CellValue(data_other.get(i), cell1);
            j = i;
            if (i > 220) {
                System.out.println("bm10101_4 sheet3:data_other.get(i),i= " + i + "," + data_other.get(i));
            }
        }
        row = sheet1.getRow(3 + j);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("HU", cell1); //        

    } catch (Exception e) {
        System.err.println("bm10101_4:printPageBody1 error is " + e);
    }
}

From source file:com.synct.report.bm10101_4.java

public void printPageBody2(int k, String[] data1, int rowno) throws IOException {
    try {//from w w w  .j a v  a2  s  . com
        //[J
        HSSFRow row = sheet2.getRow(0);
        HSSFCell cell1 = row.getCell((short) (20));
        setBig5CellValue(data1[0], cell1); //U1 LICENSE_DESC

        row = sheet2.getRow(1);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[1], cell1); //G2 P01_NAME

        row = sheet2.getRow(2);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[2], cell1); //G3 ADDR

        row = sheet2.getRow(3);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[3], cell1); //G4 LANNO

        row = sheet2.getRow(4);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[4], cell1); //G5 ADDR

        row = sheet2.getRow(5);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[5], cell1); //G6 USE_CATEGORY_CODE_DESC

        row = sheet2.getRow(6);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[6], cell1); //G7 CHWANG DONG

        row = sheet2.getRow(10);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[7], cell1); //G8 BUILDING_CATEGORY

        //*****************************************************************************
        /*
        0 1 2 3 4 5 6 7 8 910111213141516171819202122232425 6 7 8 930 1 2 3 4 5 
        A B C D E F G H I J K L M N O P Q R S T U V W X Y ZAAABACADAEAFAGAHAIAJ        
        */
        row = sheet2.getRow(8);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[8], cell1); //G9 STC1

        row = sheet2.getRow(9);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[9], cell1); //G10 AREA1

        row = sheet2.getRow(10);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[10], cell1); //G11 HEIGHT1

        row = sheet2.getRow(8);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[11], cell1); //L9 STC1

        row = sheet2.getRow(9);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[12], cell1); //L10 AREA1

        row = sheet2.getRow(10);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[13], cell1); //L11 HEIGHT1

        row = sheet2.getRow(8);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[14], cell1); //Q9 STC1

        row = sheet2.getRow(9);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[15], cell1); //Q10 AREA1

        row = sheet2.getRow(10);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[16], cell1); //Q11 HEIGHT1

        row = sheet2.getRow(8);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[17], cell1); //V9 STC1

        row = sheet2.getRow(9);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[18], cell1); //V10 AREA1

        row = sheet2.getRow(10);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[19], cell1); //V11 HEIGHT1

        row = sheet2.getRow(8);
        cell1 = row.getCell((short) (26));
        setBig5CellValue(data1[20], cell1); //AA9 STC1

        row = sheet2.getRow(9);
        cell1 = row.getCell((short) (26));
        setBig5CellValue(data1[21], cell1); //AA10 AREA1

        row = sheet2.getRow(10);
        cell1 = row.getCell((short) (26));
        setBig5CellValue(data1[22], cell1); //AA11 HEIGHT1

        row = sheet2.getRow(8);
        cell1 = row.getCell((short) (31));
        setBig5CellValue(data1[23], cell1); //AF9 STC1

        row = sheet2.getRow(9);
        cell1 = row.getCell((short) (31));
        setBig5CellValue(data1[24], cell1); //AF10 AREA1

        row = sheet2.getRow(10);
        cell1 = row.getCell((short) (31));
        setBig5CellValue(data1[25], cell1); //AF11 HEIGHT1

        row = sheet2.getRow(11);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[26], cell1); //G12 STC1

        row = sheet2.getRow(12);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[27], cell1); //G13 AREA1

        row = sheet2.getRow(13);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[28], cell1); //G14 HEIGHT1

        row = sheet2.getRow(11);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[29], cell1); //L12 STC1

        row = sheet2.getRow(12);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[30], cell1); //L13 AREA1

        row = sheet2.getRow(13);
        cell1 = row.getCell((short) (11));
        setBig5CellValue(data1[31], cell1); //L14 HEIGHT1

        row = sheet2.getRow(11);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[32], cell1); //Q12 STC1

        row = sheet2.getRow(12);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[33], cell1); //Q13 AREA1

        row = sheet2.getRow(13);
        cell1 = row.getCell((short) (16));
        setBig5CellValue(data1[34], cell1); //Q14 HEIGHT1

        row = sheet2.getRow(11);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[35], cell1); //V12 STC1

        row = sheet2.getRow(12);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[36], cell1); //V13 AREA1

        row = sheet2.getRow(13);
        cell1 = row.getCell((short) (21));
        setBig5CellValue(data1[37], cell1); //V14 HEIGHT1

        row = sheet2.getRow(14);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[38], cell1); //G15 OTHERS_NAME

        row = sheet2.getRow(15);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[39], cell1); //G16 USE LICE_DESC

        row = sheet2.getRow(16);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[40], cell1); //G17 PRICE

        row = sheet2.getRow(17);
        cell1 = row.getCell((short) (6));
        setBig5CellValue(data1[41], cell1); //G18 APPROVE_LICE_DATE

        row = sheet2.getRow(17);
        cell1 = row.getCell((short) (26));
        setBig5CellValue(data1[42], cell1); //AA18 RECEIVE_LICE_DATE

        row = sheet2.getRow(20);
        cell1 = row.getCell((short) (1));
        setBig5CellValue("W    " + data1[1], cell1); //B21 P01_NAME

        row = sheet2.getRow(27);
        cell1 = row.getCell((short) (0));
        setBig5CellValue(data1[43], cell1); //A28 IDENTIFY_LICE_DATE

    } catch (Exception e) {
        System.err.println(" sheet2:printPageBody error is " + e);
    }

}

From source file:com.synct.report.bm10101_4.java

public void printPageBody3(int k, String[] data1, int rowno) throws IOException {
    try {//  w w w  .j  a v  a 2s. c om

        HSSFRow row = sheet3.getRow(0);
        HSSFCell cell1 = row.getCell((short) (0));
        int j = 0;
        for (int i = 0; i <= data_other.size(); i++) { //A3 A4 A5 A6 A7   55*5
            row = sheet3.getRow(i); //1+i
            cell1 = row.getCell((short) (0));
            setBig5CellValue(data_other.get(i), cell1);
            j = i;
            if (i > 220) {
                System.out.println("bm10101_4 sheet3:data_other.get(i),i= " + i + "," + data_other.get(i));
            }
        }

        row = sheet3.getRow(3 + j);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("HU", cell1); //        

    } catch (Exception e) {
        System.err.println("bm10101_4:printPageBody3 error is " + e);
    }
}

From source file:com.synct.report.bm10102.java

public void printPageBody(int j, String[] data1, int rowno) throws IOException {
    try {//w w  w  . j a  v a2s  .com
        //
        HSSFRow row = sheet.getRow(2);
        HSSFCell cell1 = row.getCell((short) (0));
        setBig5CellValue(data1[0] + data1[1], cell1); //A3     LICENSE_DESC

        row = sheet.getRow(4);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("HG" + data1[2], cell1); //A5 APPL

        row = sheet.getRow(5);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("a}G" + data1[3], cell1); //A6 ADDR

        row = sheet.getRow(6);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("]ptG" + data1[4], cell1); //A7

        row = sheet.getRow(7);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("IutG" + data1[5], cell1); //A8

        row = sheet.getRow(8);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("fdcG" + data1[6], cell1); //A9

        row = sheet.getRow(9);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("dHG" + data1[7], cell1); //A10

        row = sheet.getRow(10);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("oG" + data1[8], cell1); //A11

    } catch (Exception e) {
        System.err.println("bm10102:printPageBody error is " + e);
    }

}

From source file:com.synct.report.bm10102.java

public void printPageBody2(int j, String[] data1, int rowno) throws IOException {
    try {//from w w  w .  j ava 2 s  .  co  m
        //
        HSSFRow row = sheet2.getRow(2);
        HSSFCell cell1 = row.getCell((short) (0));
        setBig5CellValue(data1[0] + data1[1], cell1); //A3     LICENSE_DESC

        row = sheet2.getRow(4);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("HG" + data1[2], cell1); //A5 APPL

        row = sheet2.getRow(5);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("a}G" + data1[3], cell1); //A6 ADDR

        row = sheet2.getRow(6);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("]ptG" + data1[4], cell1); //A7

        row = sheet2.getRow(7);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("IutG" + data1[5], cell1); //A8

        row = sheet2.getRow(8);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("fdcG" + data1[6], cell1); //A9

        row = sheet2.getRow(9);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("dHG" + data1[7], cell1); //A10

        row = sheet2.getRow(10);
        cell1 = row.getCell((short) (0));
        setBig5CellValue("oG" + data1[8], cell1); //A11

    } catch (Exception e) {
        System.err.println("bm10102:printPageBody error is " + e);
    }

}

From source file:com.synct.report.bm10104.java

private void printHeader(String[] wherestring) throws Exception {
    //gX/*from  w w  w  . j  a va 2s  .  com*/
    HSSFRow pageRow = sheet.getRow(page * page_rows);
    HSSFCell pageCell = pageRow.getCell((short) 1);

    pageRow = sheet.getRow(page * page_rows + 1);
    pageCell = pageRow.getCell((short) 0);
    setBig5CellValue(
            "XG" + Utils.convertToString(
                    DBTools.dLookUp("LM_LICNUM", "LICENSEMEMO", "SEQ=" + wherestring[0], "SynctConn")),
            pageCell);

}

From source file:com.synct.report.bm10104.java

public void printPageBody(int j, String[] data1, int rowno) throws IOException {
    try {/*from  w w w  .  j  ava  2 s. c o m*/
        //[J
        HSSFRow row = sheet.getRow(rowno);
        HSSFCell cell1 = null;

        cell1 = row.getCell((short) (0));
        setBig5CellValue(data1[0], cell1);

        cell1 = row.getCell((short) (1));
        setBig5CellValue(data1[1], cell1);

        //cell1 = row.getCell((short)(31));                                    
        //setBig5CellValue(data1[2],cell1);

    } catch (Exception e) {
        System.err.println("bi30101:printPageBody error is " + e);
    }

}

From source file:com.synct.report.bm10104_2.java

public void printPageBody(int j, String[] data1, int rowno) throws IOException {
    try {/* ww w . j a  v  a 2s .  com*/
        //[J
        HSSFRow row = sheet.getRow(rowno);
        HSSFCell cell1 = null;

        for (int g = 0; g <= 38; g++) {
            cell1 = row.getCell((short) (g));
            setBig5CellValue(data1[g], cell1);
        }

    } catch (Exception e) {
        System.err.println("bi30101:printPageBody error is " + e);
    }

}

From source file:com.synct.report.bm20113.java

private void printHeader(String[] wherestring) throws Exception {
    //gX/*from   w w w .j  av  a  2s  . c  o  m*/
    HSSFRow pageRow = sheet.getRow(page * page_rows);
    HSSFCell pageCell = pageRow.getCell((short) 1);

    //SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy/MM/dd");
    //Date current = new Date();

    String APPCASE = Utils.convertToString(
            DBTools.dLookUp("APPCASE", "MBCASEAPP_M", "CASEID='" + wherestring[0] + "'", "SynctConn"));
    String DIST_DESC = "";
    String STEP_DESC = "";

    if (!StringUtils.isEmpty(wherestring[1]))
        DIST_DESC = Utils.convertToString(
                DBTools.dLookUp("APPCASE", "MBCASEAPP_M", "CASEID='" + wherestring[0] + "'", "SynctConn"));

    if (!StringUtils.isEmpty(wherestring[2]) && wherestring[2].equals("1"))
        DIST_DESC = " ";
    else if (!StringUtils.isEmpty(wherestring[2]) && wherestring[2].equals("4"))
        DIST_DESC = " @";

    if (!StringUtils.isEmpty(wherestring[3])) {
        if (wherestring[3].equals("1")) {
            STEP_DESC = " " + wherestring[3] + "qG^";
        } else if (wherestring[3].equals("2")) {
            STEP_DESC = " " + wherestring[3] + "qG^";
        } else if (wherestring[3].equals("3")) {
            STEP_DESC = " " + wherestring[3] + "qG^]]t2q^^";
        } else if (wherestring[3].equals("4")) {
            STEP_DESC = " " + wherestring[3] + "qG^";
        }
    }

    pageRow = sheet.getRow(page * page_rows);
    pageCell = pageRow.getCell((short) 0);
    setBig5CellValue("s_Iuvu{" + APPCASE + DIST_DESC + STEP_DESC, pageCell);

}