Example usage for org.apache.poi.ss.usermodel Sheet addMergedRegion

List of usage examples for org.apache.poi.ss.usermodel Sheet addMergedRegion

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel Sheet addMergedRegion.

Prototype

int addMergedRegion(CellRangeAddress region);

Source Link

Document

Adds a merged region of cells (hence those cells form one)

Usage

From source file:com.shiyq.poi.HSSFTest.java

private static void setSheet(Sheet sheet, int startRow, int endRow, int startColumn, int endColumn,
        String describe, CellStyle descStyle) {
    Row row = sheet.getRow(startRow);/* ww  w  . j ava  2  s .  c om*/
    if (Objects.isNull(row)) {
        row = sheet.createRow(startRow);
    }
    Cell cell = row.createCell(startColumn);
    cell.setCellStyle(descStyle);
    cell.setCellValue(describe);
    sheet.addMergedRegion(new CellRangeAddress(startRow, endRow, startColumn, endColumn));
}

From source file:com.skt.adcas.lte.action.DownLinkByNMSAction.java

private void makeTrafficSheet(Workbook wb, String safeName, Map map) {
    //sheet //from w ww .  j a  v a2s  .  com
    Sheet sheet = wb.createSheet(safeName);

    //header ?
    Row hrow0 = sheet.createRow((short) 0);
    hrow0.setHeightInPoints(20);
    createCell(wb, hrow0, (short) 0, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");
    createCell(wb, hrow0, (short) 1, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); // "MB_TIME"
    createCell(wb, hrow0, (short) 2, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DU"); // "BTS_NM"
    createCell(wb, hrow0, (short) 3, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CELL ID"); // "CELL_ID"
    createCell(wb, hrow0, (short) 4, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CELL "); //  "CELL_NM"
    createCell(wb, hrow0, (short) 5, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCID"); //  "MCID"
    createCell(wb, hrow0, (short) 6, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //  "FREQ_KIND"
    createCell(wb, hrow0, (short) 7, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MIMO"); //   "MIMO_TYPE"
    createCell(wb, hrow0, (short) 8, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "(Mbps)"); //   "THROUGHPUT"
    createCell(wb, hrow0, (short) 9, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CQI ?"); //   "CQI_AVERAGE"
    createCell(wb, hrow0, (short) 10, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CQI0 (%)"); //   "RI_RATE"
    createCell(wb, hrow0, (short) 11, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RI2 (%)"); //
    createCell(wb, hrow0, (short) 12, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DL PRB(%)"); //
    createCell(wb, hrow0, (short) 13, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCS?"); //SS
    createCell(wb, hrow0, (short) 14, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RSSI"); //SS
    createCell(wb, hrow0, (short) 15, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RSSI"); //SS
    createCell(wb, hrow0, (short) 16, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MIMO "); //    ELG
    createCell(wb, hrow0, (short) 17, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DL Throughput(kbps)");//    ELG
    createCell(wb, hrow0, (short) 18, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER,
            "License  "); //    ELG
    createCell(wb, hrow0, (short) 19, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "OL MIMO (%)"); //NSN
    createCell(wb, hrow0, (short) 20, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCS0 (%)"); //NSN
    createCell(wb, hrow0, (short) 21, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RSSI"); //NSN
    createCell(wb, hrow0, (short) 22, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RSSI"); //NSN
    createCell(wb, hrow0, (short) 23, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RSSI"); //NSN
    createCell(wb, hrow0, (short) 24, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RSSI"); //NSN
    createCell(wb, hrow0, (short) 25, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 26, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 27, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 28, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 29, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 30, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 31, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 32, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 33, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "HD Voice");
    createCell(wb, hrow0, (short) 34, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "HD Voice");
    createCell(wb, hrow0, (short) 35, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "HD Voice");
    createCell(wb, hrow0, (short) 36, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "HD Voice");
    createCell(wb, hrow0, (short) 37, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 38, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 39, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 40, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??");
    createCell(wb, hrow0, (short) 41, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");
    createCell(wb, hrow0, (short) 42, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");

    Row hrow1 = sheet.createRow((short) 1);
    hrow1.setHeightInPoints(20);
    createCell(wb, hrow1, (short) 0, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");
    createCell(wb, hrow1, (short) 1, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); // "MB_TIME"
    createCell(wb, hrow1, (short) 2, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DU"); // "BTS_NM"
    createCell(wb, hrow1, (short) 3, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CELL ID"); // "CELL_ID"
    createCell(wb, hrow1, (short) 4, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CELL "); //  "CELL_NM"
    createCell(wb, hrow1, (short) 5, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCID"); //  "MCID"
    createCell(wb, hrow1, (short) 6, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //  "FREQ_KIND"
    createCell(wb, hrow1, (short) 7, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MIMO"); //  "MIMO_TYPE"
    createCell(wb, hrow1, (short) 8, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "(Mbps)"); //   "THROUGHPUT"
    createCell(wb, hrow1, (short) 9, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CQI ?"); //   "CQI_AVERAGE"
    createCell(wb, hrow1, (short) 10, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CQI0 (%)"); //   "RI_RATE"
    createCell(wb, hrow1, (short) 11, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RI2 (%)"); //
    createCell(wb, hrow1, (short) 12, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DL PRB(%)"); //
    createCell(wb, hrow1, (short) 13, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCS?"); //SS
    createCell(wb, hrow1, (short) 14, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //SS
    createCell(wb, hrow1, (short) 15, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //SS
    createCell(wb, hrow1, (short) 16, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MIMO "); //    ELG
    createCell(wb, hrow1, (short) 17, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DL Throughput(kbps)");//    ELG
    createCell(wb, hrow1, (short) 18, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER,
            "License  "); //    ELG
    createCell(wb, hrow1, (short) 19, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "OL MIMO (%)"); //NSN
    createCell(wb, hrow1, (short) 20, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCS0 (%)"); //NSN
    createCell(wb, hrow1, (short) 21, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PUCCH"); //NSN
    createCell(wb, hrow1, (short) 22, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PUCCH"); //NSN
    createCell(wb, hrow1, (short) 23, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PUSCH"); //NSN
    createCell(wb, hrow1, (short) 24, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PUSCH"); //NSN
    createCell(wb, hrow1, (short) 25, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "(MB)");
    createCell(wb, hrow1, (short) 26, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PRB(%)");
    createCell(wb, hrow1, (short) 27, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DPR(%)");
    createCell(wb, hrow1, (short) 28, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??(Erl)");
    createCell(wb, hrow1, (short) 29, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow1, (short) 30, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?(%)");
    createCell(wb, hrow1, (short) 31, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CD(%)");
    createCell(wb, hrow1, (short) 32, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "FA(%)");
    createCell(wb, hrow1, (short) 33, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "(MB)");
    createCell(wb, hrow1, (short) 34, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PRB (%)");
    createCell(wb, hrow1, (short) 35, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow1, (short) 36, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow1, (short) 37, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, " (MB)");
    createCell(wb, hrow1, (short) 38, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PRB(%)");
    createCell(wb, hrow1, (short) 39, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow1, (short) 40, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow1, (short) 41, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");
    createCell(wb, hrow1, (short) 42, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");

    Row hrow2 = sheet.createRow((short) 2);
    hrow2.setHeightInPoints(20);
    createCell(wb, hrow2, (short) 0, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");
    createCell(wb, hrow2, (short) 1, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); // "MB_TIME"
    createCell(wb, hrow2, (short) 2, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DU"); // "BTS_NM"
    createCell(wb, hrow2, (short) 3, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CELL ID"); // "CELL_ID"
    createCell(wb, hrow2, (short) 4, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CELL "); //  "CELL_NM"
    createCell(wb, hrow2, (short) 5, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCID"); //  "MCID"
    createCell(wb, hrow2, (short) 6, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //  "FREQ_KIND"
    createCell(wb, hrow2, (short) 7, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MIMO"); //  "MIMO_TYPE"
    createCell(wb, hrow2, (short) 8, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "(Mbps)"); //   "THROUGHPUT"
    createCell(wb, hrow2, (short) 9, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CQI ?"); //   "CQI_AVERAGE"
    createCell(wb, hrow2, (short) 10, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CQI0 (%)"); //   "RI_RATE"
    createCell(wb, hrow2, (short) 11, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RI2 (%)");
    createCell(wb, hrow2, (short) 12, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DL PRB(%)");
    createCell(wb, hrow2, (short) 13, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCS?"); //SS
    createCell(wb, hrow2, (short) 14, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RSSI "); //SS
    createCell(wb, hrow2, (short) 15, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "RSSI "); //SS
    createCell(wb, hrow2, (short) 16, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MIMO "); //    ELG
    createCell(wb, hrow2, (short) 17, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DL Throughput(kbps)");//    ELG
    createCell(wb, hrow2, (short) 18, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER,
            "License  "); //    ELG
    createCell(wb, hrow2, (short) 19, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "OL MIMO (%)"); //NSN
    createCell(wb, hrow2, (short) 20, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MCS0 (%)"); //NSN
    createCell(wb, hrow2, (short) 21, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //NSN
    createCell(wb, hrow2, (short) 22, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //NSN
    createCell(wb, hrow2, (short) 23, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //NSN
    createCell(wb, hrow2, (short) 24, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, ""); //NSN
    createCell(wb, hrow2, (short) 25, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "(MB)");
    createCell(wb, hrow2, (short) 26, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PRB(%)");
    createCell(wb, hrow2, (short) 27, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "DPR(%)");
    createCell(wb, hrow2, (short) 28, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "??(Erl)");
    createCell(wb, hrow2, (short) 29, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow2, (short) 30, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?(%)");
    createCell(wb, hrow2, (short) 31, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CD(%)");
    createCell(wb, hrow2, (short) 32, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "FA(%)");
    createCell(wb, hrow2, (short) 33, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "(MB)");
    createCell(wb, hrow2, (short) 34, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PRB (%)");
    createCell(wb, hrow2, (short) 35, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow2, (short) 36, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow2, (short) 37, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, " (MB)");
    createCell(wb, hrow2, (short) 38, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "PRB(%)");
    createCell(wb, hrow2, (short) 39, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow2, (short) 40, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "?");
    createCell(wb, hrow2, (short) 41, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");
    createCell(wb, hrow2, (short) 42, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "");

    sheet.addMergedRegion(new CellRangeAddress(0, 2, 0, 0)); // ("");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 1, 1)); // ("");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 2, 2)); // ("DU");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 3, 3)); // ("CELL ID");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 4, 4)); // ("CELL ");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 5, 5)); // ("MCID");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 6, 6)); // ("");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 7, 7)); // ("MIMO ");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 8, 8)); // ("(Mbps)");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 9, 9)); // ("CQI ?");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 10, 10)); // ("CQI0 (%)");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 11, 11)); // ("RI2 (%)");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 12, 12)); // ("DL PRB(%)");
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 13, 13)); // ("MCS?");

    sheet.addMergedRegion(new CellRangeAddress(0, 0, 14, 15)); // ("RSSI");    //ss
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 14, 14)); // ("");  //ss
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 15, 15)); // ("");  //ss

    sheet.addMergedRegion(new CellRangeAddress(0, 2, 16, 16)); // ("MIMO ");            //    ELG
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 17, 17)); // ("DL Throughput(kbps)");//    ELG
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 18, 18)); // ("License  "); //    ELG
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 19, 19)); // ("OL MIMO (%)");      //NSN
    sheet.addMergedRegion(new CellRangeAddress(0, 2, 20, 20)); // ("MCS0 (%)");         //NSN

    sheet.addMergedRegion(new CellRangeAddress(0, 0, 21, 24)); //  RSSI                     //NSN  
    sheet.addMergedRegion(new CellRangeAddress(1, 1, 21, 22)); //  RSSI - PUCCH             //NSN  ?
    sheet.addMergedRegion(new CellRangeAddress(1, 1, 23, 24)); //  RSSI - PUSCH             //NSN  ?
    // 4 

    sheet.addMergedRegion(new CellRangeAddress(0, 0, 25, 32)); //??
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 25, 25)); // ?? - ("(MB)");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 26, 26)); // ?? - ("PRB(%)");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 27, 27)); // ?? - ("DPR(%)");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 28, 28)); // ?? - ("??(Erl)");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 29, 29)); // ?? - ("?");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 30, 30)); // ?? - ("?(%)");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 31, 31)); // ?? - ("CD(%)");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 32, 32)); // ?? - ("FA(%)");

    sheet.addMergedRegion(new CellRangeAddress(0, 0, 33, 36)); // HD Voice
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 33, 33)); // HD Voice - ("(MB)");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 34, 34)); // HD Voice - ("PRB (%)");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 35, 35)); // HD Voice - ("?");
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 36, 36)); // HD Voice - ("?");

    sheet.addMergedRegion(new CellRangeAddress(0, 0, 37, 40)); //??
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 37, 37)); //
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 38, 38)); //
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 39, 39)); //
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 40, 40)); //

    sheet.addMergedRegion(new CellRangeAddress(0, 0, 41, 42)); //
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 41, 41)); //
    sheet.addMergedRegion(new CellRangeAddress(1, 2, 42, 42)); //

    String _MFC_CD = "MFC00001";
    ArrayList list01 = (ArrayList) map.get("rows");
    Iterator iterator = (Iterator) list01.iterator();
    short i = 3;
    while (iterator.hasNext()) {

        StringMap jrow = (StringMap) iterator.next();

        if (i == 3) {
            _MFC_CD = jrow.containsKey("MFC_CD") ? jrow.get("MFC_CD").toString() : "MFC00001";

            // hieddn  
            if (_MFC_CD.equals("MFC00001")) {
                // ?
                //                sheet.setColumnHidden(13,true);
                //                sheet.setColumnHidden(14,true);
                //                sheet.setColumnHidden(15,true);
                sheet.setColumnHidden(16, true);
                sheet.setColumnHidden(17, true);
                sheet.setColumnHidden(18, true);
                sheet.setColumnHidden(19, true);
                sheet.setColumnHidden(20, true);
                sheet.setColumnHidden(21, true);
                sheet.setColumnHidden(22, true);
                sheet.setColumnHidden(23, true);
                sheet.setColumnHidden(24, true);
            } else if (_MFC_CD.equals("MFC00002")) {
                sheet.setColumnHidden(13, true);
                sheet.setColumnHidden(14, true);
                sheet.setColumnHidden(15, true);
                //                sheet.setColumnHidden(16,true);
                //                sheet.setColumnHidden(17,true);
                //                sheet.setColumnHidden(18,true);
                sheet.setColumnHidden(19, true);
                sheet.setColumnHidden(20, true);
                //                        sheet.setColumnHidden(21,true);
                //                        sheet.setColumnHidden(22,true);
                //                        sheet.setColumnHidden(23,true);
                //                        sheet.setColumnHidden(24,true);
            } else if (_MFC_CD.equals("MFC00014")) {
                sheet.setColumnHidden(13, true);
                sheet.setColumnHidden(14, true);
                sheet.setColumnHidden(15, true);
                sheet.setColumnHidden(16, true);
                sheet.setColumnHidden(17, true);
                sheet.setColumnHidden(18, true);
                //                sheet.setColumnHidden(19,true);
                //                sheet.setColumnHidden(20,true);
                //                sheet.setColumnHidden(21,true);
                //                sheet.setColumnHidden(22,true);
                //                sheet.setColumnHidden(23,true);
                //                sheet.setColumnHidden(24,true);
            }

        }

        //  
        Row row = sheet.createRow((short) i);
        row.setHeightInPoints(20);

        row.createCell(0).setCellValue((String) jrow.get("YMD"));
        row.createCell(1).setCellValue((String) jrow.get("MB_TIME"));
        row.createCell(2).setCellValue((String) jrow.get("BTS_NM"));
        row.createCell(3).setCellValue((String) jrow.get("CELL_ID"));
        row.createCell(4).setCellValue((String) jrow.get("CELL_NM"));
        row.createCell(5).setCellValue((String) jrow.get("MCID"));
        row.createCell(6).setCellValue((String) jrow.get("FREQ_KIND"));
        row.createCell(7).setCellValue(jrow.containsKey("MIMO_TYPE") ? jrow.get("MIMO_TYPE").toString() : "-"); // ");       //   "MIMO_TYPE"       //?

        setCellDoubleIfExistValue(row.createCell(8), jrow, "THROUGHPUT"); // (Mbps)");       //   "THROUGHPUT"
        setCellDoubleIfExistValue(row.createCell(9), jrow, "CQI_AVERAGE"); // CQI ?");         //   "CQI_AVERAGE"
        setCellDoubleIfExistValue(row.createCell(10), jrow, "CQI0_RATE"); // CQI0 (%)");         //   "RI_RATE"
        setCellDoubleIfExistValue(row.createCell(11), jrow, "RI_RATE"); // RI2 (%)");
        setCellDoubleIfExistValue(row.createCell(12), jrow, "DL_PRB_RATE"); // DL PRB(%)");

        /**/
        setCellDoubleIfExistValue(row.createCell(13), jrow, "MCS_AVERAGE"); // MCS?");               //SS
        setCellDoubleIfExistValue(row.createCell(14), jrow, "RSSI"); // RSSI ");          //SS
        setCellDoubleIfExistValue(row.createCell(15), jrow, "R2_RSSI"); // RSSI ");          //SS
        setCellDoubleIfExistValue(row.createCell(16), jrow, "MIMO_RATE"); // MIMO ");             //    ELG
        setCellDoubleIfExistValue(row.createCell(17), jrow, "DL_THROUGHPUT"); // DL Throughput(kbps)");   //    ELG
        setCellDoubleIfExistValue(row.createCell(18), jrow, "LICENSE_FAIL"); // License  ");   //    ELG
        setCellDoubleIfExistValue(row.createCell(19), jrow, "MIMO_RATE"); // OL MIMO (%)");           //ELG + NSN
        setCellDoubleIfExistValue(row.createCell(20), jrow, "MCS_AVERAGE"); // MCS0 (%)");         //ELG + NSN
        setCellDoubleIfExistValue(row.createCell(21), jrow, "PUCCH_AVG"); // RSSI PUCCH ");        //ELG + NSN
        setCellDoubleIfExistValue(row.createCell(22), jrow, "R2_PUCCH_AVG"); // RSSI PUCCH "); //NSN
        setCellDoubleIfExistValue(row.createCell(23), jrow, "PUSCH_AVG"); // RSSI PUSCH ");        //NSN
        setCellDoubleIfExistValue(row.createCell(24), jrow, "R2_PUSCH_AVG"); // RSSI PUSCH "); //NSN

        /**/
        setCellDoubleIfExistValue(row.createCell(25), jrow, "PDCP_DL_MB"); // ?? (MB)");
        setCellDoubleIfExistValue(row.createCell(26), jrow, "PRB_USG_RATE"); // ?? PRB(%)");
        setCellDoubleIfExistValue(row.createCell(27), jrow, "DRB_USG_RATE"); // ?? DPR(%)");
        setCellDoubleIfExistValue(row.createCell(28), jrow, "CON_TIME"); // ?? ??(Erl)");
        setCellDoubleIfExistValue(row.createCell(29), jrow, "TRY_CCNT"); // ?? ?");
        setCellDoubleIfExistValue(row.createCell(30), jrow, "CON_RATE"); // ?? ?(%)");
        setCellDoubleIfExistValue(row.createCell(31), jrow, "CDC_RATE"); // ?? CD(%)");
        setCellDoubleIfExistValue(row.createCell(32), jrow, "DL_FA_USG_RATE"); //?? FA(%)

        setCellDoubleIfExistValue(row.createCell(33), jrow, "VOICE_DL_MB");
        setCellDoubleIfExistValue(row.createCell(34), jrow, "VOICE_DL_PRB"); // HD Voice PRB (%)");
        setCellDoubleIfExistValue(row.createCell(35), jrow, "VOICE_TRY_CCNT"); // HD Voice ?");
        setCellDoubleIfExistValue(row.createCell(36), jrow, "VOICE_TIME"); // HD Voice ?");
        setCellDoubleIfExistValue(row.createCell(37), jrow, "IMAGE_DL_MB"); // ??  (MB)");
        setCellDoubleIfExistValue(row.createCell(38), jrow, "IMAGE_DL_PRB"); // ?? PRB(%)");
        setCellDoubleIfExistValue(row.createCell(39), jrow, "IMAGE_TRY_CCNT"); // ?? ?");
        setCellDoubleIfExistValue(row.createCell(40), jrow, "IMAGE_TIME"); // ?? ?");
        row.createCell(41).setCellValue((String) jrow.get("CHNL_TYPE")); //  ");
        setCellDoubleIfExistValue(row.createCell(42), jrow, "CHNL_COUNT"); //  ");

        i++;

    }

}

From source file:com.skt.adcas.lte.action.DownLinkByNMSStatsAction.java

public void createCellTrafficStatsExcelSheet(Sheet sheet, String searchType, Map<String, Object> map)
        throws Exception {

    this.log.debug("createCellTrafficStatsExcelSheet Start");

    //header ?/*from   www. j  a va 2s  . c o  m*/
    log.debug("createCellTrafficStatsExcelSheet : hrow0 start");
    Row hrow0 = sheet.createRow((short) 0);
    hrow0.setHeightInPoints(20);
    int a = 0;

    hrow0.createCell(a++).setCellValue("");
    if (searchType.equalsIgnoreCase("BONBU")) {
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM")) {
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("CITY")) {
        hrow0.createCell(a++).setCellValue("?//");
    } else if (searchType.equalsIgnoreCase("UNI")) {
        hrow0.createCell(a++).setCellValue("?//");
        hrow0.createCell(a++).setCellValue("//");
    }
    hrow0.createCell(a++).setCellValue("");
    hrow0.createCell(a++).setCellValue("(Mbps)"); //"(Mbps) : THROUGHPUT"
    hrow0.createCell(a++).setCellValue("CQI ?"); //"CQI ? : CQI_AVERAGE"
    hrow0.createCell(a++).setCellValue("CQI0 "); //"CQI0  : CQI0_RATE"
    hrow0.createCell(a++).setCellValue("RI2 (%)"); //"RI2 (%) : RI_RATE"
    hrow0.createCell(a++).setCellValue("DL PRB (%)"); //"DL PRB (%) : DL_PRB_RATE"
    hrow0.createCell(a++).setCellValue("MCS ?"); //"MCS ? : MCS_AVERAGE"
    hrow0.createCell(a++).setCellValue("MIMO "); //"MIMO  : MIMO_RATE"
    hrow0.createCell(a++).setCellValue("DL Throughput(Kbps)"); //"DL Throughput(Kbps) : DL_THROUGHPUT"
    hrow0.createCell(a++).setCellValue("License "); //"License  : LICENSE_FAIL"
    hrow0.createCell(a++).setCellValue("OL MIMO (%)"); //"OL MIMO (%) : MIMO_RATE"
    hrow0.createCell(a++).setCellValue("MCS0 (%)"); //"MCS0 (%) : MCS_AVERAGE"
    hrow0.createCell(a++).setCellValue("RSSI"); //"PUCCH- : PUCCH_AVG"
    hrow0.createCell(a++).setCellValue("RSSI"); //"PUCCH- : R2_PUCCH_AVG"
    hrow0.createCell(a++).setCellValue("RSSI"); //"PUSCH- : PUSCH_AVG"
    hrow0.createCell(a++).setCellValue("RSSI"); //"PUSCH- : R2_PUSCH_AVG"
    hrow0.createCell(a++).setCellValue("?? (dBm)"); //"?? (dBm)-(MB) : PDCP_DL_MB"
    hrow0.createCell(a++).setCellValue("?? (dBm)"); //"?? (dBm)-PRB (%) : PRB_USG_RATE"
    hrow0.createCell(a++).setCellValue("?? (dBm)"); //"?? (dBm)-DRB (%) : DRB_USG_RATE"
    hrow0.createCell(a++).setCellValue("?? (dBm)"); //"?? (dBm)-?? : CON_TIME"
    hrow0.createCell(a++).setCellValue("?? (dBm)"); //"?? (dBm)-? : TRY_CCNT"
    hrow0.createCell(a++).setCellValue("?? (dBm)"); //"?? (dBm)-?(%) : CON_RATE"
    hrow0.createCell(a++).setCellValue("?? (dBm)"); //"?? (dBm)-CD(%) : CDC_RATE"
    hrow0.createCell(a++).setCellValue("?? (dBm)"); //"?? (dBm)-FA (%)"
    hrow0.createCell(a++).setCellValue("HD Voice"); //"HD Voice - (MB)"
    hrow0.createCell(a++).setCellValue("HD Voice"); //"HD Voice - PRB (%)"
    hrow0.createCell(a++).setCellValue("HD Voice"); //"HD Voice - ?"
    hrow0.createCell(a++).setCellValue("HD Voice"); //"HD Voice - ?"
    hrow0.createCell(a++).setCellValue("??"); //"?? - (MB)"
    hrow0.createCell(a++).setCellValue("??"); //"?? - PRB (%)"
    hrow0.createCell(a++).setCellValue("??"); //"?? - ?"
    hrow0.createCell(a++).setCellValue("??"); //"?? - ?"
    //        hrow0.createCell(a++).setCellValue("");               //""
    //        hrow0.createCell(a++).setCellValue("");               //""

    log.debug("createCellTrafficStatsExcelSheet : hrow0 end");
    log.debug("createCellTrafficStatsExcelSheet : hrow1 start");
    Row hrow1 = sheet.createRow((short) 1);
    hrow1.setHeightInPoints(20);
    int b = 0;
    hrow1.createCell(b++).setCellValue(""); //
    if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
            || searchType.equalsIgnoreCase("EMS")) {
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
    }
    hrow1.createCell(b++).setCellValue(""); //
    hrow1.createCell(b++).setCellValue(""); //"(Mbps) : THROUGHPUT"
    hrow1.createCell(b++).setCellValue(""); //"CQI ? : CQI_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); //"CQI0  : CQI0_RATE"
    hrow1.createCell(b++).setCellValue(""); //"RI2 (%) : RI_RATE"
    hrow1.createCell(b++).setCellValue(""); //"DL PRB (%) : DL_PRB_RATE"
    hrow1.createCell(b++).setCellValue(""); //"MCS ? : MCS_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); //"MIMO  : MIMO_RATE"
    hrow1.createCell(b++).setCellValue(""); //"DL Throughput(Kbps) : DL_THROUGHPUT"
    hrow1.createCell(b++).setCellValue(""); //"License  : LICENSE_FAIL"
    hrow1.createCell(b++).setCellValue(""); //"OL MIMO (%) : MIMO_RATE"
    hrow1.createCell(b++).setCellValue(""); //"MCS0 (%) : MCS_AVERAGE"
    hrow1.createCell(b++).setCellValue("PUCCH"); //"PUCCH- : PUCCH_AVG"
    hrow1.createCell(b++).setCellValue("PUCCH"); //"PUCCH- : R2_PUCCH_AVG"
    hrow1.createCell(b++).setCellValue("PUSCH"); //"PUSCH- : PUSCH_AVG"
    hrow1.createCell(b++).setCellValue("PUSCH"); //"PUSCH- : R2_PUSCH_AVG"
    hrow1.createCell(b++).setCellValue("(MB)"); //"?? (dBm)-(MB) : PDCP_DL_MB"
    hrow1.createCell(b++).setCellValue("PRB (%)"); //"?? (dBm)-PRB (%) : PRB_USG_RATE"
    hrow1.createCell(b++).setCellValue("DRB (%)"); //"?? (dBm)-DRB (%) : DRB_USG_RATE"
    hrow1.createCell(b++).setCellValue("??"); //"?? (dBm)-?? : CON_TIME"
    hrow1.createCell(b++).setCellValue("?"); //"?? (dBm)-? : TRY_CCNT"
    hrow1.createCell(b++).setCellValue("?(%)"); //"?? (dBm)-?(%) : CON_RATE"
    hrow1.createCell(b++).setCellValue("CD(%)"); //"?? (dBm)-CD(%) : CDC_RATE"
    hrow1.createCell(b++).setCellValue("FA (%)"); //"?? (dBm)-FA (%)"
    hrow1.createCell(b++).setCellValue("(MB)"); //"HD Voice - (MB)"
    hrow1.createCell(b++).setCellValue("PRB (%)"); //"HD Voice - PRB (%)"
    hrow1.createCell(b++).setCellValue("?"); //"HD Voice - ?"
    hrow1.createCell(b++).setCellValue("?"); //"HD Voice - ?"
    hrow1.createCell(b++).setCellValue("(MB)"); //"?? - (MB)"
    hrow1.createCell(b++).setCellValue("PRB (%)"); //"?? - PRB (%)"
    hrow1.createCell(b++).setCellValue("?"); //"?? - ?"
    hrow1.createCell(b++).setCellValue("?"); //"?? - ?"
    //        hrow1.createCell(b++).setCellValue("");           //"-"
    //        hrow1.createCell(b++).setCellValue("");           //"-"

    log.debug("createCellTrafficStatsExcelSheet : hrow1 end");

    log.debug("createCellTrafficStatsExcelSheet : hrow2 start");
    Row hrow2 = sheet.createRow((short) 2);
    hrow2.setHeightInPoints(20);
    int c = 0;
    hrow2.createCell(c++).setCellValue(""); //
    if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
            || searchType.equalsIgnoreCase("EMS")) {
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
    }
    hrow2.createCell(c++).setCellValue(""); //
    hrow2.createCell(c++).setCellValue(""); //"(Mbps) : THROUGHPUT"
    hrow2.createCell(c++).setCellValue(""); //"CQI ? : CQI_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); //"CQI0  : CQI0_RATE"
    hrow2.createCell(c++).setCellValue(""); //"RI2 (%) : RI_RATE"
    hrow2.createCell(c++).setCellValue(""); //"DL PRB (%) : DL_PRB_RATE"
    hrow2.createCell(c++).setCellValue(""); //"MCS ? : MCS_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); //"MIMO  : MIMO_RATE"
    hrow2.createCell(c++).setCellValue(""); //"DL Throughput(Kbps) : DL_THROUGHPUT"
    hrow2.createCell(c++).setCellValue(""); //"License  : LICENSE_FAIL"
    hrow2.createCell(c++).setCellValue(""); //"OL MIMO (%) : MIMO_RATE"
    hrow2.createCell(c++).setCellValue(""); //"MCS0 (%) : MCS_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); //"PUCCH- : PUCCH_AVG"
    hrow2.createCell(c++).setCellValue(""); //"PUCCH- : R2_PUCCH_AVG"
    hrow2.createCell(c++).setCellValue(""); //"PUSCH- : PUSCH_AVG"
    hrow2.createCell(c++).setCellValue(""); //"PUSCH- : R2_PUSCH_AVG"
    hrow2.createCell(c++).setCellValue(""); //"?? (dBm)-(MB) : PDCP_DL_MB"
    hrow2.createCell(c++).setCellValue(""); //"?? (dBm)-PRB (%) : PRB_USG_RATE"
    hrow2.createCell(c++).setCellValue(""); //"?? (dBm)-DRB (%) : DRB_USG_RATE"
    hrow2.createCell(c++).setCellValue(""); //"?? (dBm)-?? : CON_TIME"
    hrow2.createCell(c++).setCellValue(""); //"?? (dBm)-? : TRY_CCNT"
    hrow2.createCell(c++).setCellValue(""); //"?? (dBm)-?(%) : CON_RATE"
    hrow2.createCell(c++).setCellValue(""); //"?? (dBm)-CD(%) : CDC_RATE"
    hrow2.createCell(c++).setCellValue(""); //"?? (dBm)-FA (%)"
    hrow2.createCell(c++).setCellValue(""); //"HD Voice - (MB)"
    hrow2.createCell(c++).setCellValue(""); //"HD Voice - PRB (%)"
    hrow2.createCell(c++).setCellValue(""); //"HD Voice - ?"
    hrow2.createCell(c++).setCellValue(""); //"HD Voice - ?"
    hrow2.createCell(c++).setCellValue(""); //"?? - (MB)"
    hrow2.createCell(c++).setCellValue(""); //"?? - PRB (%)"
    hrow2.createCell(c++).setCellValue(""); //"?? - ?"
    hrow2.createCell(c++).setCellValue(""); //"?? - ?"
    //        hrow2.createCell(c++).setCellValue("");               //"-"
    //        hrow2.createCell(c++).setCellValue("");               //"-"

    int d = 0;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // ""
    if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
            || searchType.equalsIgnoreCase("EMS")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    } else if (searchType.equalsIgnoreCase("PART")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    }
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"(Mbps) : THROUGHPUT"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"CQI ? : CQI_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"CQI0  : CQI0_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"RI2 (%) : RI_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"DL PRB (%) : DL_PRB_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"MCS ? : MCS_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"MIMO  : MIMO_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"DL Throughput(Kbps) : DL_THROUGHPUT"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"License  : LICENSE_FAIL"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"OL MIMO (%) : MIMO_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); //"MCS0 (%) : MCS_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 3)); //"RSSI"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d, d + 1)); //"Total(PUCCH)"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d + 2, d + 3)); // "Total(PUSCH)"
    d += 4;
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 7)); //"?? (dBm)"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d, d)); //"?? (dBm)-(MB) : PDCP_DL_MB"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 1, d + 1)); //"?? (dBm)-PRB (%) : PRB_USG_RATE"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 2, d + 2)); //"?? (dBm)-DRB (%) : DRB_USG_RATE"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 3, d + 3)); //"?? (dBm)-?? : CON_TIME"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 4, d + 4)); //"?? (dBm)-? : TRY_CCNT"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 5, d + 5)); //"?? (dBm)-?(%) : CON_RATE"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 6, d + 6)); //"?? (dBm)-CD(%) : CDC_RATE"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 7, d + 7)); //"?? (dBm)-FA (%)"
    d += 8;
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 3)); //"HD Voice"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d, d)); //"HD Voice - (MB)"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 1, d + 1)); //"HD Voice - PRB (%)"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 2, d + 2)); //"HD Voice - ?"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 3, d + 3)); //"HD Voice - ?"
    d += 4;
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 3)); //"??"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d, d)); //"?? - (MB)"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 1, d + 1)); //"?? - PRB (%)"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 2, d + 2)); //"?? - ?"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 3, d + 3)); //"?? - ?"
    d += 4;
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 1)); // ""
    //        sheet.addMergedRegion(new CellRangeAddress(1,2,d,d));     // "-"
    //        sheet.addMergedRegion(new CellRangeAddress(1,2,d+1,d+1)); // "-"

    log.debug("createCellTrafficStatsExcelSheet : hrow2 end");

    log.debug("createCellTrafficStatsExcelSheet : row start");
    ArrayList list01 = (ArrayList) map.get("rows");
    Iterator iterator = (Iterator) list01.iterator();
    short i = 3;
    while (iterator.hasNext()) {
        StringMap jrow = (StringMap) iterator.next();
        //  
        Row row = sheet.createRow((short) i);
        row.setHeightInPoints(20);
        int e = 0;
        row.createCell(e++).setCellValue((String) jrow.get("YMD"));
        if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
        } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
                || searchType.equalsIgnoreCase("EMS")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE02"));
        } else if (searchType.equalsIgnoreCase("PART")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE02"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE03"));
        }
        row.createCell(e++).setCellValue((String) jrow.get("FREQ_KIND"));

        setCellDoubleIfExistValue(row.createCell(e++), jrow, "THROUGHPUT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI0_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RI_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_PRB_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "MCS_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "MIMO_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_THROUGHPUT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "LICENSE_FAIL");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "MIMO_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "MCS_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "PUCCH_AVG");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "R2_PUCCH_AVG");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "PUSCH_AVG");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "R2_PUSCH_AVG");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "PDCP_DL_MB");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "PRB_USG_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DRB_USG_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CON_TIME");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "TRY_CCNT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CON_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CDC_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_FA_USG_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "VOICE_DL_MB");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "VOICE_DL_PRB");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "VOICE_TRY_CCNT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "VOICE_TIME");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "IMAGE_DL_MB");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "IMAGE_DL_PRB");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "IMAGE_TRY_CCNT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "IMAGE_TIME");
        //            row.createCell(e++).setCellValue("n/a");
        //            row.createCell(e++).setCellValue("n/a");
        i++;
    }

    log.debug("createCellTrafficStatsExcelSheet : row end");

    this.log.debug("createCellTrafficStatsExcelSheet End");

}

From source file:com.skt.adcas.lte.action.DownLinkByQMSAction.java

public void createCellTrafficExcelSheet(Sheet sheet, Map<String, Object> map) throws Exception {

    this.log.debug("createCellTrafficExcelSheet Start");

    Row hrow0 = sheet.createRow((short) 0);
    hrow0.setHeightInPoints(20);/*ww w  .j  a  v a 2  s.  c o m*/
    int a = 0;
    hrow0.createCell(a++).setCellValue(""); // "YMD"
    hrow0.createCell(a++).setCellValue("DU"); // "BTS_NM"
    hrow0.createCell(a++).setCellValue("CELL ID"); // "CELL_ID"
    hrow0.createCell(a++).setCellValue("CELL "); // "CELL_NM"
    hrow0.createCell(a++).setCellValue(""); // "FREQ_KIND"
    hrow0.createCell(a++).setCellValue("DL Throughput(Mbps)"); // "DL_TPUT"
    hrow0.createCell(a++).setCellValue("UL Throughput(Mbps)"); // "UL_TPUT"
    hrow0.createCell(a++).setCellValue("CQI ?"); // "CQI_AVERAGE"
    hrow0.createCell(a++).setCellValue("RI2 "); // "RI_RANK_INDEX
    hrow0.createCell(a++).setCellValue("MCS ?"); // "MCS_AVERAGE"
    hrow0.createCell(a++).setCellValue("RSRP ?"); // "RSRP_AVERAGE
    hrow0.createCell(a++).setCellValue("RSSI ?"); // "RSSI_AVERAGE"
    hrow0.createCell(a++).setCellValue("SINR ?"); // "SINR_AVERAGE"
    hrow0.createCell(a++).setCellValue("RSRQ ?"); // "RSRQ_AVERAGE"
    hrow0.createCell(a++).setCellValue("PUCCH Tx ?"); // "TXPW_PUCCH"
    hrow0.createCell(a++).setCellValue("CQI0 "); // "CQI0_RATE"
    hrow0.createCell(a++).setCellValue("DL PRB "); // "DL_PRB_RATE"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI0_PUCCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI1_PUCCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI0_PUSCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI1_PUSCH"
    hrow0.createCell(a++).setCellValue("License  "); // "LICENSE_FAIL"
    //        hrow0.createCell(a++).setCellValue("");               // ""
    //        hrow0.createCell(a++).setCellValue("");               // ""

    Row hrow1 = sheet.createRow((short) 1);
    hrow1.setHeightInPoints(20);
    int b = 0;
    hrow1.createCell(b++).setCellValue(""); // "YMD"
    hrow1.createCell(b++).setCellValue(""); // "BTS_NM"
    hrow1.createCell(b++).setCellValue(""); // "CELL_ID"
    hrow1.createCell(b++).setCellValue(""); // "CELL_NM"
    hrow1.createCell(b++).setCellValue(""); // "FREQ_KIND"
    hrow1.createCell(b++).setCellValue(""); // "DL_TPUT"
    hrow1.createCell(b++).setCellValue(""); // "UL_TPUT"
    hrow1.createCell(b++).setCellValue(""); // "CQI_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "RI_RANK_INDEX
    hrow1.createCell(b++).setCellValue(""); // "MCS_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "RSRP_AVERAGE
    hrow1.createCell(b++).setCellValue(""); // "RSSI_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "SINR_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "RSRQ_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "TXPW_PUCCH"
    hrow1.createCell(b++).setCellValue(""); // "CQI0_RATE"
    hrow1.createCell(b++).setCellValue(""); // "DL_PRB_RATE"
    hrow1.createCell(b++).setCellValue("Total(PUCCH)"); // "RSSI0_PUCCH"
    hrow1.createCell(b++).setCellValue("Total(PUCCH)"); // "RSSI1_PUCCH"
    hrow1.createCell(b++).setCellValue("Total(PUSCH)"); // "RSSI0_PUSCH"
    hrow1.createCell(b++).setCellValue("Total(PUSCH)"); // "RSSI1_PUSCH"
    hrow1.createCell(b++).setCellValue(""); // "LICENSE_FAIL"
    //        hrow1.createCell(b++).setCellValue("");          // "-"
    //        hrow1.createCell(b++).setCellValue("");          // "-"

    Row hrow2 = sheet.createRow((short) 2);
    hrow2.setHeightInPoints(20);
    int c = 0;
    hrow2.createCell(c++).setCellValue(""); // "YMD"
    hrow2.createCell(c++).setCellValue(""); // "BTS_NM"
    hrow2.createCell(c++).setCellValue(""); // "CELL_ID"
    hrow2.createCell(c++).setCellValue(""); // "CELL_NM"
    hrow2.createCell(c++).setCellValue(""); // "FREQ_KIND"
    hrow2.createCell(c++).setCellValue(""); // "DL_TPUT"
    hrow2.createCell(c++).setCellValue(""); // "UL_TPUT"
    hrow2.createCell(c++).setCellValue(""); // "CQI_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "RI_RANK_INDEX
    hrow2.createCell(c++).setCellValue(""); // "MCS_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "RSRP_AVERAGE
    hrow2.createCell(c++).setCellValue(""); // "RSSI_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "SINR_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "RSRQ_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "TXPW_PUCCH"
    hrow2.createCell(c++).setCellValue(""); // "CQI0_RATE"
    hrow2.createCell(c++).setCellValue(""); // "DL_PRB_RATE"
    hrow2.createCell(c++).setCellValue(""); // "RSSI0_PUCCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI1_PUCCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI0_PUSCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI1_PUSCH"
    hrow2.createCell(c++).setCellValue(""); // "LICENSE_FAIL"
    //        hrow2.createCell(c++).setCellValue("");       // "-"
    //        hrow2.createCell(c++).setCellValue("");       // "-"

    int d = 0;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "YMD"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "BTS_NM"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CELL_ID"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CELL_NM"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "FREQ_KIND"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "DL_TPUT"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "UL_TPUT"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CQI_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RI_RANK_INDEX
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "MCS_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RSRP_AVERAGE
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RSSI_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "SINR_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RSRQ_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "TXPW_PUCCH"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CQI0_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "DL_PRB_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 3)); // "RSSI"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d, d + 1)); // "Total(PUCCH)"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d + 2, d + 3)); // "Total(PUSCH)"
    d += 4;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "LICENSE_FAIL"
    //        sheet.addMergedRegion(new CellRangeAddress(0,0,d,d+1));   // ""
    //        sheet.addMergedRegion(new CellRangeAddress(1,2,d,d));     // "-"
    //        sheet.addMergedRegion(new CellRangeAddress(1,2,d+1,d+1)); // "-"

    ArrayList list01 = (ArrayList) map.get("rows");
    Iterator iterator = (Iterator) list01.iterator();
    short i = 3;
    while (iterator.hasNext()) {
        StringMap jrow = (StringMap) iterator.next();
        //  
        Row row = sheet.createRow((short) i);
        row.setHeightInPoints(20);
        int e = 0;
        row.createCell(e++).setCellValue((String) jrow.get("YMD"));
        row.createCell(e++).setCellValue((String) jrow.get("BTS_NM"));
        row.createCell(e++).setCellValue((String) jrow.get("CELL_ID"));
        row.createCell(e++).setCellValue((String) jrow.get("CELL_NM"));
        row.createCell(e++).setCellValue((String) jrow.get("FREQ_KIND"));

        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_TPUT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "UL_TPUT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RANK_INDEX");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "MCS_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSRP_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "SINR_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSRQ_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "TXPW_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI0_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_PRB_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI0_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI1_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI0_PUSCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI1_PUSCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "LICENSE_FAIL");
        //            row.createCell(e++).setCellValue("n/a");
        //            row.createCell(e++).setCellValue("n/a");
        i++;

    }

    this.log.debug("createCellTrafficExcelSheet End");

}

From source file:com.skt.adcas.lte.action.DownLinkByQMSStatsAction.java

public void createCellTrafficStatsExcelSheet(Sheet sheet, String searchType, Map<String, Object> map)
        throws Exception {

    this.log.debug("createCellTrafficStatsExcelSheet Start");

    //header ?//  www  .  ja va2  s . c  o  m
    log.debug("createCellTrafficStatsExcelSheet : hrow start");

    Row hrow0 = sheet.createRow((short) 0);
    hrow0.setHeightInPoints(20);
    int a = 0;
    hrow0.createCell(a++).setCellValue("");
    if (searchType.equalsIgnoreCase("BONBU")) {
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM")) {
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("CITY")) {
        hrow0.createCell(a++).setCellValue("?//");
    } else if (searchType.equalsIgnoreCase("UNI")) {
        hrow0.createCell(a++).setCellValue("?//");
        hrow0.createCell(a++).setCellValue("//");
    } else if (searchType.equalsIgnoreCase("EMS")) {
        hrow0.createCell(a++).setCellValue("MME GROUP");
        hrow0.createCell(a++).setCellValue("EMS");
    }
    hrow0.createCell(a++).setCellValue(""); // "FREQ_KIND"
    hrow0.createCell(a++).setCellValue("DL Throughput(Mbps)"); // "DL_TPUT"
    hrow0.createCell(a++).setCellValue("UL Throughput(Mbps)"); // "UL_TPUT"
    hrow0.createCell(a++).setCellValue("CQI ?"); // "CQI_AVERAGE"
    hrow0.createCell(a++).setCellValue("RI2 "); // "RI_RANK_INDEX
    hrow0.createCell(a++).setCellValue("MCS ?"); // "MCS_AVERAGE"
    hrow0.createCell(a++).setCellValue("RSRP ?"); // "RSRP_AVERAGE
    hrow0.createCell(a++).setCellValue("RSSI ?"); // "RSSI_AVERAGE"
    hrow0.createCell(a++).setCellValue("SINR ?"); // "SINR_AVERAGE"
    hrow0.createCell(a++).setCellValue("RSRQ ?"); // "RSRQ_AVERAGE"
    hrow0.createCell(a++).setCellValue("PUCCH Tx ?"); // "TXPW_PUCCH"
    hrow0.createCell(a++).setCellValue("CQI0 "); // "CQI0_RATE"
    hrow0.createCell(a++).setCellValue("DL PRB "); // "DL_PRB_RATE"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI0_PUCCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI1_PUCCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI0_PUSCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI1_PUSCH"
    hrow0.createCell(a++).setCellValue("License  "); // "LICENSE_FAIL"
    //        hrow0.createCell(a++).setCellValue("");               // ""
    //        hrow0.createCell(a++).setCellValue("");               // ""

    Row hrow1 = sheet.createRow((short) 1);
    hrow1.setHeightInPoints(20);
    int b = 0;
    hrow1.createCell(b++).setCellValue("");
    if (searchType.equalsIgnoreCase("BONBU")) {
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM")) {
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("CITY")) {
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("UNI")) {
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("EMS")) {
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
    }
    hrow1.createCell(b++).setCellValue(""); // "FREQ_KIND"
    hrow1.createCell(b++).setCellValue(""); // "DL_TPUT"
    hrow1.createCell(b++).setCellValue(""); // "UL_TPUT"
    hrow1.createCell(b++).setCellValue(""); // "CQI_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "RI_RANK_INDEX
    hrow1.createCell(b++).setCellValue(""); // "MCS_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "RSRP_AVERAGE
    hrow1.createCell(b++).setCellValue(""); // "RSSI_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "SINR_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "RSRQ_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "TXPW_PUCCH"
    hrow1.createCell(b++).setCellValue(""); // "CQI0_RATE"
    hrow1.createCell(b++).setCellValue(""); // "DL_PRB_RATE"
    hrow1.createCell(b++).setCellValue("Total(PUCCH)"); // "RSSI0_PUCCH"
    hrow1.createCell(b++).setCellValue("Total(PUCCH)"); // "RSSI1_PUCCH"
    hrow1.createCell(b++).setCellValue("Total(PUSCH)"); // "RSSI0_PUSCH"
    hrow1.createCell(b++).setCellValue("Total(PUSCH)"); // "RSSI1_PUSCH"
    hrow1.createCell(b++).setCellValue(""); // "LICENSE_FAIL"
    //        hrow1.createCell(b++).setCellValue("");          // "-"
    //        hrow1.createCell(b++).setCellValue("");          // "-"

    Row hrow2 = sheet.createRow((short) 2);
    hrow2.setHeightInPoints(20);
    int c = 0;
    hrow2.createCell(c++).setCellValue("");
    if (searchType.equalsIgnoreCase("BONBU")) {
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM")) {
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("CITY")) {
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("UNI")) {
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("EMS")) {
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
    }
    hrow2.createCell(c++).setCellValue(""); // "FREQ_KIND"
    hrow2.createCell(c++).setCellValue(""); // "DL_TPUT"
    hrow2.createCell(c++).setCellValue(""); // "UL_TPUT"
    hrow2.createCell(c++).setCellValue(""); // "CQI_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "RI_RANK_INDEX
    hrow2.createCell(c++).setCellValue(""); // "MCS_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "RSRP_AVERAGE
    hrow2.createCell(c++).setCellValue(""); // "RSSI_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "SINR_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "RSRQ_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "TXPW_PUCCH"
    hrow2.createCell(c++).setCellValue(""); // "CQI0_RATE"
    hrow2.createCell(c++).setCellValue(""); // "DL_PRB_RATE"
    hrow2.createCell(c++).setCellValue(""); // "RSSI0_PUCCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI1_PUCCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI0_PUSCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI1_PUSCH"
    hrow2.createCell(c++).setCellValue(""); // "LICENSE_FAIL"
    //        hrow2.createCell(c++).setCellValue("");       // "-"
    //        hrow2.createCell(c++).setCellValue("");       // "-"

    int d = 0;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // ""
    if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
            || searchType.equalsIgnoreCase("EMS")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    } else if (searchType.equalsIgnoreCase("PART")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    }
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "FREQ_KIND"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "DL_TPUT"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "UL_TPUT"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CQI_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RI_RANK_INDEX
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "MCS_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RSRP_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RSSI_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "SINR_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RSRQ_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "TXPW_PUCCH"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CQI0_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "DL_PRB_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 3)); // "RSSI"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d, d + 1)); // "Total(PUCCH)"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d + 2, d + 3)); // "Total(PUSCH)"
    d += 4;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "LICENSE_FAIL"
    //        sheet.addMergedRegion(new CellRangeAddress(0,0,d,d+1));   // ""
    //        sheet.addMergedRegion(new CellRangeAddress(1,2,d,d));     // "-"
    //        sheet.addMergedRegion(new CellRangeAddress(1,2,d+1,d+1)); // "-"

    log.debug("createCellTrafficStatsExcelSheet : hrow end");

    log.debug("createCellTrafficStatsExcelSheet : row start");
    ArrayList list01 = (ArrayList) map.get("rows");
    Iterator iterator = (Iterator) list01.iterator();
    short i = 3;
    while (iterator.hasNext()) {
        StringMap jrow = (StringMap) iterator.next();
        //  
        Row row = sheet.createRow((short) i);
        row.setHeightInPoints(20);
        int e = 0;
        row.createCell(e++).setCellValue((String) jrow.get("YMD"));
        if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
        } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
                || searchType.equalsIgnoreCase("EMS")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE02"));
        } else if (searchType.equalsIgnoreCase("PART")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE02"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE03"));
        }
        row.createCell(e++).setCellValue((String) jrow.get("FREQ_KIND"));

        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_TPUT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "UL_TPUT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RANK_INDEX");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "MCS_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSRP_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "SINR_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSRQ_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "TXPW_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI0_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_PRB_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI0_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI1_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI0_PUSCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI1_PUSCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "LICENSE_FAIL");
        //            row.createCell(e++).setCellValue("n/a");
        //            row.createCell(e++).setCellValue("n/a");
        i++;
    }

    log.debug("createCellTrafficStatsExcelSheet : row end");

    this.log.debug("createCellTrafficStatsExcelSheet End");

}

From source file:com.skt.adcas.lte.action.DownLinkBySTDAction.java

public void createCellTrafficExcelSheet(Sheet sheet, Map<String, Object> map) throws Exception {

    this.log.debug("createCellTrafficExcelSheet Start");

    Row hrow0 = sheet.createRow((short) 0);
    hrow0.setHeightInPoints(20);//from w  w w . ja  va 2 s.co m
    int a = 0;
    hrow0.createCell(a++).setCellValue(""); // "YMD"
    hrow0.createCell(a++).setCellValue("DU"); // "BTS_NM"
    hrow0.createCell(a++).setCellValue("CELL ID"); // "CELL_ID"
    hrow0.createCell(a++).setCellValue("CELL "); // "CELL_NM"
    hrow0.createCell(a++).setCellValue("MCID"); // "MCID"
    hrow0.createCell(a++).setCellValue(""); // "FREQ_KIND"
    hrow0.createCell(a++).setCellValue("(Mbps)"); // "THROUGHPUT"
    hrow0.createCell(a++).setCellValue("CQI ?"); // "CQI_AVERAGE"
    hrow0.createCell(a++).setCellValue("CQI0  "); // "CQI0_RATE"
    hrow0.createCell(a++).setCellValue("RI2 "); // "RI_RATE"
    hrow0.createCell(a++).setCellValue("DL PRB "); // "DL_PRB_RATE"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI0_PUCCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI1_PUCCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI0_PUSCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI1_PUSCH"
    hrow0.createCell(a++).setCellValue("License  "); // "LICENSE_FAIL"
    hrow0.createCell(a++).setCellValue(""); // ""
    hrow0.createCell(a++).setCellValue(""); // ""

    Row hrow1 = sheet.createRow((short) 1);
    hrow1.setHeightInPoints(20);
    int b = 0;
    hrow1.createCell(b++).setCellValue(""); // "YMD"
    hrow1.createCell(b++).setCellValue(""); // "BTS_NM"
    hrow1.createCell(b++).setCellValue(""); // "CELL_ID"
    hrow1.createCell(b++).setCellValue(""); // "CELL_NM"
    hrow1.createCell(b++).setCellValue(""); // "MCID"
    hrow1.createCell(b++).setCellValue(""); // "FREQ_KIND"
    hrow1.createCell(b++).setCellValue(""); // "THROUGHPUT"
    hrow1.createCell(b++).setCellValue(""); // "CQI_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "CQI0_RATE"
    hrow1.createCell(b++).setCellValue(""); // "RI_RATE"
    hrow1.createCell(b++).setCellValue(""); // "DL_PRB_RATE"
    hrow1.createCell(b++).setCellValue("Total(PUCCH)"); // "SI0_PUCCH"
    hrow1.createCell(b++).setCellValue("Total(PUCCH)"); // "SI1_PUCCH"
    hrow1.createCell(b++).setCellValue("Total(PUSCH)"); // "SI0_PUSCH"
    hrow1.createCell(b++).setCellValue("Total(PUSCH)"); // "SI1_PUSCH"
    hrow1.createCell(b++).setCellValue(""); // "LICENSE_FAIL"
    hrow1.createCell(b++).setCellValue(""); // "-"
    hrow1.createCell(b++).setCellValue(""); // "-"

    Row hrow2 = sheet.createRow((short) 2);
    hrow2.setHeightInPoints(20);
    int c = 0;
    hrow2.createCell(c++).setCellValue(""); // "YMD"
    hrow2.createCell(c++).setCellValue(""); // "BTS_NM"
    hrow2.createCell(c++).setCellValue(""); // "CELL_ID"
    hrow2.createCell(c++).setCellValue(""); // "CELL_NM"
    hrow2.createCell(c++).setCellValue(""); // "MCID"
    hrow2.createCell(c++).setCellValue(""); // "FREQ_KIND"
    hrow2.createCell(c++).setCellValue(""); // "THROUGHPUT"
    hrow2.createCell(c++).setCellValue(""); // "CQI_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "CQI0_RATE"
    hrow2.createCell(c++).setCellValue(""); // "RI_RATE"
    hrow2.createCell(c++).setCellValue(""); // "DL_PRB_RATE"
    hrow2.createCell(c++).setCellValue(""); //  "RI0_PUCCH"
    hrow2.createCell(c++).setCellValue(""); //  "RI1_PUCCH"
    hrow2.createCell(c++).setCellValue(""); //  "RI0_PUSCH"
    hrow2.createCell(c++).setCellValue(""); //  "RI1_PUSCH"
    hrow2.createCell(c++).setCellValue(""); // "LICENSE_FAIL"
    hrow2.createCell(c++).setCellValue(""); // "-"
    hrow2.createCell(c++).setCellValue(""); // "-"

    int d = 0;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "YMD"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "BTS_NM"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CELL_ID"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CELL_NM"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "MCID"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "FREQ_KIND"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "THROUGHPUT"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CQI_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CQI0_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RI_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "DL_PRB_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 3)); // "RSSI"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d, d + 1)); // "Total(PUCCH)"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d + 2, d + 3)); // "Total(PUSCH)"
    d += 4;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "LICENSE_FAIL"
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 1)); // ""
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d, d)); // "-"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 1, d + 1)); // "-"

    ArrayList list01 = (ArrayList) map.get("rows");
    Iterator iterator = (Iterator) list01.iterator();
    short i = 3;
    while (iterator.hasNext()) {
        StringMap jrow = (StringMap) iterator.next();
        //  
        Row row = sheet.createRow((short) i);
        row.setHeightInPoints(20);
        int e = 0;
        row.createCell(e++).setCellValue((String) jrow.get("YMD"));
        row.createCell(e++).setCellValue((String) jrow.get("BTS_NM"));
        row.createCell(e++).setCellValue((String) jrow.get("CELL_ID"));
        row.createCell(e++).setCellValue((String) jrow.get("CELL_NM"));
        row.createCell(e++).setCellValue((String) jrow.get("MCID"));
        row.createCell(e++).setCellValue((String) jrow.get("FREQ_KIND"));

        setCellDoubleIfExistValue(row.createCell(e++), jrow, "THROUGHPUT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI0_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RI_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_PRB_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI0_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI1_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI0_PUSCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI1_PUSCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "LICENSE_FAIL");
        row.createCell(e++).setCellValue((String) jrow.get("CHNL_TYPE")); //  ");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CHNL_COUNT"); //  ");

        i++;

    }

    this.log.debug("createCellTrafficExcelSheet End");

}

From source file:com.skt.adcas.lte.action.DownLinkBySTDStatsAction.java

public void createCellTrafficStatsExcelSheet(Sheet sheet, Map<String, Object> map, String searchType)
        throws Exception {

    this.log.debug("createCellTrafficStatsExcelSheet Start");

    Row hrow0 = sheet.createRow((short) 0);
    hrow0.setHeightInPoints(20);//  www . j  a  va2  s  .co m
    int a = 0;
    hrow0.createCell(a++).setCellValue("");
    if (searchType.equalsIgnoreCase("BONBU")) {
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM")) {
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
        hrow0.createCell(a++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("CITY")) {
        hrow0.createCell(a++).setCellValue("?//");
    } else if (searchType.equalsIgnoreCase("UNI")) {
        hrow0.createCell(a++).setCellValue("?//");
        hrow0.createCell(a++).setCellValue("//");
    } else if (searchType.equalsIgnoreCase("EMS")) {
        hrow0.createCell(a++).setCellValue("MME GROUP");
        hrow0.createCell(a++).setCellValue("EMS");
    }
    hrow0.createCell(a++).setCellValue(""); // "FREQ_KIND"
    hrow0.createCell(a++).setCellValue("(Mbps)"); // "THROUGHPUT"
    hrow0.createCell(a++).setCellValue("CQI ?"); // "CQI_AVERAGE"
    hrow0.createCell(a++).setCellValue("CQI0  "); // "CQI0_RATE"
    hrow0.createCell(a++).setCellValue("RI2 "); // "RI_RATE"
    hrow0.createCell(a++).setCellValue("DL PRB "); // "DL_PRB_RATE"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI0_PUCCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI1_PUCCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI0_PUSCH"
    hrow0.createCell(a++).setCellValue("RSSI"); // "RSSI1_PUSCH"
    hrow0.createCell(a++).setCellValue("License  "); // "LICENSE_FAIL"
    //hrow0.createCell(a++).setCellValue("");                 // ""
    //hrow0.createCell(a++).setCellValue("");                 // ""

    Row hrow1 = sheet.createRow((short) 1);
    hrow1.setHeightInPoints(20);
    int b = 0;
    hrow1.createCell(b++).setCellValue("");
    if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
            || searchType.equalsIgnoreCase("EMS")) {
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
        hrow1.createCell(b++).setCellValue("");
    }
    hrow1.createCell(b++).setCellValue(""); // "FREQ_KIND"
    hrow1.createCell(b++).setCellValue(""); // "THROUGHPUT"
    hrow1.createCell(b++).setCellValue(""); // "CQI_AVERAGE"
    hrow1.createCell(b++).setCellValue(""); // "CQI0_RATE"
    hrow1.createCell(b++).setCellValue(""); // "RI_RATE"
    hrow1.createCell(b++).setCellValue(""); // "DL_PRB_RATE"
    hrow1.createCell(b++).setCellValue("Total(PUCCH)"); // "RSSI0_PUCCH"
    hrow1.createCell(b++).setCellValue("Total(PUCCH)"); // "RSSI1_PUCCH"
    hrow1.createCell(b++).setCellValue("Total(PUSCH)"); // "RSSI0_PUSCH"
    hrow1.createCell(b++).setCellValue("Total(PUSCH)"); // "RSSI1_PUSCH"
    hrow1.createCell(b++).setCellValue(""); // "LICENSE_FAIL"
    //hrow1.createCell(b++).setCellValue("");           // ""
    //hrow1.createCell(b++).setCellValue("");           // ""

    Row hrow2 = sheet.createRow((short) 2);
    hrow2.setHeightInPoints(20);
    int c = 0;
    hrow2.createCell(c++).setCellValue("");
    if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
            || searchType.equalsIgnoreCase("EMS")) {
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
    } else if (searchType.equalsIgnoreCase("PART")) {
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
        hrow2.createCell(c++).setCellValue("");
    }
    hrow2.createCell(c++).setCellValue(""); // "FREQ_KIND"
    hrow2.createCell(c++).setCellValue(""); // "THROUGHPUT"
    hrow2.createCell(c++).setCellValue(""); // "CQI_AVERAGE"
    hrow2.createCell(c++).setCellValue(""); // "CQI0_RATE"
    hrow2.createCell(c++).setCellValue(""); // "RI_RATE"
    hrow2.createCell(c++).setCellValue(""); // "DL_PRB_RATE"
    hrow2.createCell(c++).setCellValue(""); // "RSSI0_PUCCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI1_PUCCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI0_PUSCH"
    hrow2.createCell(c++).setCellValue(""); // "RSSI1_PUSCH"
    hrow2.createCell(c++).setCellValue(""); // "LICENSE_FAIL"
    hrow2.createCell(c++).setCellValue(""); // "-"
    hrow2.createCell(c++).setCellValue(""); // "-"

    int d = 0;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // ""
    if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
            || searchType.equalsIgnoreCase("EMS")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    } else if (searchType.equalsIgnoreCase("PART")) {
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
        sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++));
    }
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "FREQ_KIND"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "THROUGHPUT"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CQI_AVERAGE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "CQI0_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "RI_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "DL_PRB_RATE"
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 3)); //"RSSI"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d, d + 1)); //"Total(PUCCH)"
    sheet.addMergedRegion(new CellRangeAddress(1, 1, d + 2, d + 3)); // "Total(PUSCH)"
    d += 4;
    sheet.addMergedRegion(new CellRangeAddress(0, 2, d, d++)); // "LICENSE_FAIL"
    sheet.addMergedRegion(new CellRangeAddress(0, 0, d, d + 1)); // ""
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d, d)); // "-"
    sheet.addMergedRegion(new CellRangeAddress(1, 2, d + 1, d + 1)); // "-"

    ArrayList list01 = (ArrayList) map.get("rows");
    Iterator iterator = (Iterator) list01.iterator();
    short i = 3;
    while (iterator.hasNext()) {
        StringMap jrow = (StringMap) iterator.next();
        //  
        Row row = sheet.createRow((short) i);
        row.setHeightInPoints(20);
        int e = 0;
        row.createCell(e++).setCellValue((String) jrow.get("YMD"));
        if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
        } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
                || searchType.equalsIgnoreCase("EMS")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE02"));
        } else if (searchType.equalsIgnoreCase("PART")) {
            row.createCell(e++).setCellValue((String) jrow.get("TITLE01"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE02"));
            row.createCell(e++).setCellValue((String) jrow.get("TITLE03"));
        }
        row.createCell(e++).setCellValue((String) jrow.get("FREQ_KIND"));

        setCellDoubleIfExistValue(row.createCell(e++), jrow, "THROUGHPUT");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI_AVERAGE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "CQI0_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RI_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "DL_PRB_RATE");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI0_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI1_PUCCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI0_PUSCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "RSSI1_PUSCH");
        setCellDoubleIfExistValue(row.createCell(e++), jrow, "LICENSE_FAIL");
        // row.createCell(e++).setCellValue("n/a");
        // row.createCell(e++).setCellValue("n/a");
        i++;

    }

    this.log.debug("createCellTrafficStatsExcelSheet End");
}

From source file:com.solidmaps.webapp.report.TimesheetDemo.java

License:Apache License

public void main(String[] args) throws Exception {
    Workbook wb = new HSSFWorkbook();

    Map<String, CellStyle> styles = createStyles(wb);

    Sheet sheet = wb.createSheet("Timesheet");
    PrintSetup printSetup = sheet.getPrintSetup();
    printSetup.setLandscape(true);/*from   ww  w.  ja v a2 s . c o  m*/
    sheet.setFitToPage(true);
    sheet.setHorizontallyCenter(true);

    //title row
    Row titleRow = sheet.createRow(0);
    titleRow.setHeightInPoints(45);
    Cell titleCell = titleRow.createCell(0);
    titleCell.setCellValue("Weekly Timesheet");
    titleCell.setCellStyle(styles.get("title"));
    sheet.addMergedRegion(CellRangeAddress.valueOf("$A$1:$L$1"));

    //header row
    Row headerRow = sheet.createRow(1);
    headerRow.setHeightInPoints(40);
    Cell headerCell;
    for (int i = 0; i < titles.length; i++) {
        headerCell = headerRow.createCell(i);
        headerCell.setCellValue(titles[i]);
        headerCell.setCellStyle(styles.get("header"));
    }

    int rownum = 2;
    for (int i = 0; i < 10; i++) {
        Row row = sheet.createRow(rownum++);
        for (int j = 0; j < titles.length; j++) {
            Cell cell = row.createCell(j);
            if (j == 9) {
                //the 10th cell contains sum over week days, e.g. SUM(C3:I3)
                String ref = "C" + rownum + ":I" + rownum;
                cell.setCellFormula("SUM(" + ref + ")");
                cell.setCellStyle(styles.get("formula"));
            } else if (j == 11) {
                cell.setCellFormula("J" + rownum + "-K" + rownum);
                cell.setCellStyle(styles.get("formula"));
            } else {
                cell.setCellStyle(styles.get("cell"));
            }
        }
    }

    //row with totals below
    Row sumRow = sheet.createRow(rownum++);
    sumRow.setHeightInPoints(35);
    Cell cell;
    cell = sumRow.createCell(0);
    cell.setCellStyle(styles.get("formula"));
    cell = sumRow.createCell(1);
    cell.setCellValue("Total Hrs:");
    cell.setCellStyle(styles.get("formula"));

    for (int j = 2; j < 12; j++) {
        cell = sumRow.createCell(j);
        String ref = (char) ('A' + j) + "3:" + (char) ('A' + j) + "12";
        cell.setCellFormula("SUM(" + ref + ")");
        if (j >= 9)
            cell.setCellStyle(styles.get("formula_2"));
        else
            cell.setCellStyle(styles.get("formula"));
    }
    rownum++;
    sumRow = sheet.createRow(rownum++);
    sumRow.setHeightInPoints(25);
    cell = sumRow.createCell(0);
    cell.setCellValue("Total Regular Hours");
    cell.setCellStyle(styles.get("formula"));
    cell = sumRow.createCell(1);
    cell.setCellFormula("L13");
    cell.setCellStyle(styles.get("formula_2"));
    sumRow = sheet.createRow(rownum++);
    sumRow.setHeightInPoints(25);
    cell = sumRow.createCell(0);
    cell.setCellValue("Total Overtime Hours");
    cell.setCellStyle(styles.get("formula"));
    cell = sumRow.createCell(1);
    cell.setCellFormula("K13");
    cell.setCellStyle(styles.get("formula_2"));

    //set sample data
    for (int i = 0; i < sample_data.length; i++) {
        Row row = sheet.getRow(2 + i);
        for (int j = 0; j < sample_data[i].length; j++) {
            if (sample_data[i][j] == null)
                continue;

            if (sample_data[i][j] instanceof String) {
                row.getCell(j).setCellValue((String) sample_data[i][j]);
            } else {
                row.getCell(j).setCellValue((Double) sample_data[i][j]);
            }
        }
    }

    //finally set column widths, the width is measured in units of 1/256th of a character width
    sheet.setColumnWidth(0, 30 * 256); //30 characters wide
    for (int i = 2; i < 9; i++) {
        sheet.setColumnWidth(i, 6 * 256); //6 characters wide
    }
    sheet.setColumnWidth(10, 10 * 256); //10 characters wide

    // Write the output to a file
    String file = "/home/brunorocca/Desktop/mapa_teste.xls";
    if (wb instanceof XSSFWorkbook)
        file += "x";
    FileOutputStream out = new FileOutputStream(file);
    wb.write(out);
    out.close();
}

From source file:com.tecnosur.util.Excel.java

public void ExportarMatriculados(CControlmatricula datos, String aula) {
    try { // Defino el Libro de Excel
        HSSFWorkbook wb = new HSSFWorkbook();

        // Creo la Hoja en Excel
        Sheet sheet = wb.createSheet("matriculados");

        // quito las lineas del libro para darle un mejor acabado
        sheet.setDisplayGridlines(false);
        sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 6));

        // creo una nueva fila
        Row trow = sheet.createRow((short) 1);

        createTituloCell(wb, trow, 0, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER,
                "ALUMNOS MATRICULADOS");

        Row trow2 = sheet.createRow((short) 3);
        createTituloCell(wb, trow2, 0, CellStyle.ALIGN_LEFT, CellStyle.VERTICAL_CENTER, "AULA: " + aula);

        // Creo la cabecera de mi listado en Excel
        Row row = sheet.createRow((short) 5);

        // Creo las celdas de mi fila, se puede poner un diseo a la celda_codigo
        createCell(wb, row, 0, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CDIGO", true, true);
        createCell(wb, row, 1, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "ALUMNO", true, true);
        createCell(wb, row, 2, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "TIPO PAGO", true, true);
        createCell(wb, row, 3, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "CRONO. PAGO", true, true);
        createCell(wb, row, 4, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "N CUOT.", true, true);
        createCell(wb, row, 5, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MON. MATR.", true, true);
        createCell(wb, row, 6, CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER, "MON. CUOT.", true, true);

        // Definimos el tamao de las celdas, podemos definir un tamaa especifico o hacer que 
        //la celda_codigo se acomode segn su tamao
        Sheet ssheet = wb.getSheetAt(0);
        ssheet.setColumnWidth(0, 60 * 40);
        ssheet.setColumnWidth(1, 255 * 40);
        ssheet.setColumnWidth(2, 90 * 40);
        ssheet.autoSizeColumn(3);//from   w  w  w .j a  v  a 2 s  . c  om
        ssheet.autoSizeColumn(4);
        ssheet.autoSizeColumn(5);
        ssheet.autoSizeColumn(6);

        HSSFFont cellFont = wb.createFont();

        cellFont.setFontHeightInPoints((short) 8);
        cellFont.setFontName(HSSFFont.FONT_ARIAL);

        CellStyle cellStyle = wb.createCellStyle();

        cellStyle.setFont(cellFont);
        cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
        cellStyle.setLeftBorderColor((short) 8);
        cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
        cellStyle.setRightBorderColor((short) 8);
        cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
        cellStyle.setBottomBorderColor((short) 8);

        for (int i = 0; i < datos.size(); i++) {
            row = sheet.createRow((short) i + 6);
            Cell celda_codigo = row.createCell(0);

            celda_codigo.setCellStyle(cellStyle);
            celda_codigo.setCellValue(datos.get(i).getIdalumno());

            Cell celda_alumno = row.createCell(1);
            celda_alumno.setCellStyle(cellStyle);
            celda_alumno.setCellValue(datos.get(i).getNom_completo());

            Cell celda_tipopago = row.createCell(2);
            celda_tipopago.setCellStyle(cellStyle);
            celda_tipopago.setCellValue(datos.get(i).getTipopagante());

            Cell celda_crono = row.createCell(3);
            celda_crono.setCellStyle(cellStyle);
            celda_crono.setCellValue(datos.get(i).getDesc_cronopagtable());

            Cell celda_ncuota = row.createCell(4);
            celda_ncuota.setCellStyle(cellStyle);
            celda_ncuota.setCellValue(datos.get(i).getNum_cuota());

            Cell celda_matricula = row.createCell(5);
            celda_matricula.setCellStyle(cellStyle);
            celda_matricula.setCellValue(datos.get(i).getMonmatricula());

            Cell celda_moncuota = row.createCell(6);
            celda_moncuota.setCellStyle(cellStyle);
            celda_moncuota.setCellValue(datos.get(i).getMoncuota());
        }

        String strRuta = "TYSAC_Matriculados.xls";
        FileOutputStream fileOut = new FileOutputStream(strRuta);
        wb.write(fileOut);

        fileOut.close();
        Runtime.getRuntime().exec("cmd /c start " + strRuta);

    } catch (IOException e) {
        System.out.println("Error de escritura");
        e.printStackTrace();
    }
}

From source file:com.tikal.tallerWeb.servicio.reporte.cliente.BitacoraReporteCliente.java

License:Apache License

@Override
public BordeSeccion generar(BordeSeccion borde, ContextoSeccion contexto, ReporteCliente datos) {
    Sheet sheet = contexto.getSheet();
    XSSFWorkbook wb = contexto.getWb();/*from ww  w.  j av  a 2  s.  c  om*/
    int initialRow = borde.getUpperRow();
    int initialColumn = borde.getLeftColumn();
    BordeSeccion r = new BordeSeccion();
    r.setLeftColumn(initialColumn);
    r.setUpperRow(initialRow);

    Row row = getRow(sheet, initialRow);
    Cell cell = row.createCell(initialColumn);
    cell.setCellValue("Bitacora");
    XSSFCellStyle cellStyle = wb.createCellStyle();
    addHeaderStyle(cellStyle, wb);
    addBorders(wb, cellStyle, CellStyle.BORDER_MEDIUM);
    cell.setCellStyle(cellStyle);

    for (int i = 1; i < 4; i++) {
        cell = row.createCell(initialColumn + i);
        cellStyle = wb.createCellStyle();
        addBorders(wb, cellStyle, CellStyle.BORDER_MEDIUM);
        cell.setCellStyle(cellStyle);
    }

    //merge de celdas
    sheet.addMergedRegion(new CellRangeAddress(initialRow, //first row (0-based)
            initialRow, //last row  (0-based)
            initialColumn, //first column (0-based)
            initialColumn + 3 //last column  (0-based)
    ));

    CreationHelper createHelper = wb.getCreationHelper();
    for (EventoRC x : datos.getBitacora()) {
        initialRow = initialRow + 1;
        row = getRow(sheet, initialRow);
        for (int i = 0; i < atributos.length; i++) {
            cell = row.createCell(initialColumn + i);
            cellStyle = wb.createCellStyle();
            try {
                if (atributos[i].equals("fecha")) {
                    cellStyle.setDataFormat(createHelper.createDataFormat().getFormat("yy/m/d h:mm:ss"));
                    cell.setCellValue((Date) PropertyUtils.getProperty(x, atributos[i]));
                } else {
                    cell.setCellValue(PropertyUtils.getProperty(x, atributos[i]).toString());
                }
            } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
                cell.setCellValue("");
            }
            addBorders(wb, cellStyle, CellStyle.BORDER_THIN);
            cell.setCellStyle(cellStyle);
        }
    }
    r.setLowerRow(initialRow);
    r.setRightColumn(initialColumn + 3);
    paintBorder(wb, sheet, CellStyle.BORDER_MEDIUM, r);
    return r;
}