Example usage for org.apache.poi.ss.usermodel Row setHeightInPoints

List of usage examples for org.apache.poi.ss.usermodel Row setHeightInPoints

Introduction

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

Prototype

void setHeightInPoints(float height);

Source Link

Document

Set the row's height in points.

Usage

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

public String selectDailyCellTrafficCQIExcelDownload() {

    this.log.debug("selectDailyCellTrafficCQIExcelDownload Start");
    SqlSession session = null;//  w ww . ja va 2  s. co  m
    FileOutputStream fileOut = null;

    try {
        parseParam();
        log.debug(this.MFC_CD);
        String[] CQINAME = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14",
                "15" };
        if (MFC_CD.equals("MFC00002")) {
            CQINAME[0] = "1";
            CQINAME[1] = "2";
            CQINAME[2] = "3";
            CQINAME[3] = "4";
            CQINAME[4] = "5";
            CQINAME[5] = "6";
            CQINAME[6] = "7";
            CQINAME[7] = "8";
            CQINAME[8] = "9";
            CQINAME[9] = "10";
            CQINAME[10] = "11";
            CQINAME[12] = "12";
            CQINAME[13] = "13";
            CQINAME[14] = "14";
            CQINAME[15] = "15";
        }

        Type type = new TypeToken<Map<String, Object>>() {
        }.getType();
        Gson gson = new Gson();
        Map<String, Object> map = gson.fromJson(this.JSONDATA, type);

        //log.debug("json data : " + this.JSONDATA);

        Workbook wb = new HSSFWorkbook();

        //PDFsheet 
        String sheetName = "CQI PDF";
        String safeName = WorkbookUtil.createSafeSheetName(sheetName);
        Sheet PDFsheet = wb.createSheet(safeName);
        //CDFsheet 
        sheetName = "CQI CDF";
        safeName = WorkbookUtil.createSafeSheetName(sheetName);
        Sheet CDFsheet = wb.createSheet(safeName);

        //header ?
        Row PDFhrow0 = PDFsheet.createRow((short) 0);
        PDFhrow0.setHeightInPoints(20);
        PDFhrow0.createCell(0).setCellValue(""); // "YMD"
        PDFhrow0.createCell(1).setCellValue(""); // "MB_TIME"
        PDFhrow0.createCell(2).setCellValue("DU"); // "BTS_NM"
        PDFhrow0.createCell(3).setCellValue("CELL ID"); // "CELL_ID"
        PDFhrow0.createCell(4).setCellValue("CELL "); //  "CELL_NM"
        PDFhrow0.createCell(5).setCellValue("MCID"); //  "MCID"
        PDFhrow0.createCell(6).setCellValue(""); //  "MCID"
        PDFhrow0.createCell(7).setCellValue("PDF-" + CQINAME[0]);
        PDFhrow0.createCell(8).setCellValue("PDF-" + CQINAME[1]);
        PDFhrow0.createCell(9).setCellValue("PDF-" + CQINAME[2]);
        PDFhrow0.createCell(10).setCellValue("PDF-" + CQINAME[3]);
        PDFhrow0.createCell(11).setCellValue("PDF-" + CQINAME[4]);
        PDFhrow0.createCell(12).setCellValue("PDF-" + CQINAME[5]);
        PDFhrow0.createCell(13).setCellValue("PDF-" + CQINAME[6]);
        PDFhrow0.createCell(14).setCellValue("PDF-" + CQINAME[7]);
        PDFhrow0.createCell(15).setCellValue("PDF-" + CQINAME[8]);
        PDFhrow0.createCell(16).setCellValue("PDF-" + CQINAME[9]);
        PDFhrow0.createCell(17).setCellValue("PDF-" + CQINAME[10]);
        PDFhrow0.createCell(18).setCellValue("PDF-" + CQINAME[11]);
        PDFhrow0.createCell(19).setCellValue("PDF-" + CQINAME[12]);
        PDFhrow0.createCell(20).setCellValue("PDF-" + CQINAME[13]);
        PDFhrow0.createCell(21).setCellValue("PDF-" + CQINAME[14]);
        PDFhrow0.createCell(22).setCellValue("PDF-" + CQINAME[15]);
        //header ?
        Row CDFhrow0 = CDFsheet.createRow((short) 0);
        CDFhrow0.setHeightInPoints(20);
        CDFhrow0.createCell(0).setCellValue(""); // "YMD"
        CDFhrow0.createCell(1).setCellValue(""); // "MB_TIME"
        CDFhrow0.createCell(2).setCellValue("DU"); // "BTS_NM"
        CDFhrow0.createCell(3).setCellValue("CELL ID"); // "CELL_ID"
        CDFhrow0.createCell(4).setCellValue("CELL "); //  "CELL_NM"
        CDFhrow0.createCell(5).setCellValue("MCID"); //  "MCID"
        CDFhrow0.createCell(6).setCellValue(""); //  "MCID"
        CDFhrow0.createCell(7).setCellValue("CDF-" + CQINAME[0]);
        CDFhrow0.createCell(8).setCellValue("CDF-" + CQINAME[1]);
        CDFhrow0.createCell(9).setCellValue("CDF-" + CQINAME[2]);
        CDFhrow0.createCell(10).setCellValue("CDF-" + CQINAME[3]);
        CDFhrow0.createCell(11).setCellValue("CDF-" + CQINAME[4]);
        CDFhrow0.createCell(12).setCellValue("CDF-" + CQINAME[5]);
        CDFhrow0.createCell(13).setCellValue("CDF-" + CQINAME[6]);
        CDFhrow0.createCell(14).setCellValue("CDF-" + CQINAME[7]);
        CDFhrow0.createCell(15).setCellValue("CDF-" + CQINAME[8]);
        CDFhrow0.createCell(16).setCellValue("CDF-" + CQINAME[9]);
        CDFhrow0.createCell(17).setCellValue("CDF-" + CQINAME[10]);
        CDFhrow0.createCell(18).setCellValue("CDF-" + CQINAME[11]);
        CDFhrow0.createCell(19).setCellValue("CDF-" + CQINAME[12]);
        CDFhrow0.createCell(20).setCellValue("CDF-" + CQINAME[13]);
        CDFhrow0.createCell(21).setCellValue("CDF-" + CQINAME[14]);
        CDFhrow0.createCell(22).setCellValue("CDF-" + CQINAME[15]);

        ArrayList list01 = (ArrayList) map.get("rows");
        Iterator iterator = (Iterator) list01.iterator();
        short i = 1;
        while (iterator.hasNext()) {
            StringMap jrow = (StringMap) iterator.next();
            //  
            Row PDFrow = PDFsheet.createRow((short) i);
            Row CDFrow = CDFsheet.createRow((short) i);
            PDFrow.setHeightInPoints(20);
            CDFrow.setHeightInPoints(20);

            PDFrow.createCell(0).setCellValue((String) jrow.get("YMD"));
            PDFrow.createCell(1).setCellValue((String) jrow.get("MB_TIME"));
            PDFrow.createCell(2).setCellValue((String) jrow.get("BTS_NM"));
            PDFrow.createCell(3).setCellValue((String) jrow.get("CELL_ID"));
            PDFrow.createCell(4).setCellValue((String) jrow.get("CELL_NM"));
            PDFrow.createCell(5).setCellValue((String) jrow.get("MCID"));
            PDFrow.createCell(6).setCellValue((String) jrow.get("FREQ_KIND"));

            CDFrow.createCell(0).setCellValue((String) jrow.get("YMD"));
            CDFrow.createCell(1).setCellValue((String) jrow.get("MB_TIME"));
            CDFrow.createCell(2).setCellValue((String) jrow.get("BTS_NM"));
            CDFrow.createCell(3).setCellValue((String) jrow.get("CELL_ID"));
            CDFrow.createCell(4).setCellValue((String) jrow.get("CELL_NM"));
            CDFrow.createCell(5).setCellValue((String) jrow.get("MCID"));
            CDFrow.createCell(6).setCellValue((String) jrow.get("FREQ_KIND"));

            PDFrow.createCell(7).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_00") ? jrow.get("CQI_PDF_00").toString() : "0"));
            PDFrow.createCell(8).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_01") ? jrow.get("CQI_PDF_01").toString() : "0"));
            PDFrow.createCell(9).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_02") ? jrow.get("CQI_PDF_02").toString() : "0"));
            PDFrow.createCell(10).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_03") ? jrow.get("CQI_PDF_03").toString() : "0"));
            PDFrow.createCell(11).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_04") ? jrow.get("CQI_PDF_04").toString() : "0"));
            PDFrow.createCell(12).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_05") ? jrow.get("CQI_PDF_05").toString() : "0"));
            PDFrow.createCell(13).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_06") ? jrow.get("CQI_PDF_06").toString() : "0"));
            PDFrow.createCell(14).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_07") ? jrow.get("CQI_PDF_07").toString() : "0"));
            PDFrow.createCell(15).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_08") ? jrow.get("CQI_PDF_08").toString() : "0"));
            PDFrow.createCell(16).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_09") ? jrow.get("CQI_PDF_09").toString() : "0"));
            PDFrow.createCell(17).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_10") ? jrow.get("CQI_PDF_10").toString() : "0"));
            PDFrow.createCell(18).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_11") ? jrow.get("CQI_PDF_11").toString() : "0"));
            PDFrow.createCell(19).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_12") ? jrow.get("CQI_PDF_12").toString() : "0"));
            PDFrow.createCell(20).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_13") ? jrow.get("CQI_PDF_13").toString() : "0"));
            PDFrow.createCell(21).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_14") ? jrow.get("CQI_PDF_14").toString() : "0"));
            PDFrow.createCell(22).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_PDF_15") ? jrow.get("CQI_PDF_15").toString() : "0"));

            CDFrow.createCell(7).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_00") ? jrow.get("CQI_CDF_00").toString() : "0"));
            CDFrow.createCell(8).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_01") ? jrow.get("CQI_CDF_01").toString() : "0"));
            CDFrow.createCell(9).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_02") ? jrow.get("CQI_CDF_02").toString() : "0"));
            CDFrow.createCell(10).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_03") ? jrow.get("CQI_CDF_03").toString() : "0"));
            CDFrow.createCell(11).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_04") ? jrow.get("CQI_CDF_04").toString() : "0"));
            CDFrow.createCell(12).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_05") ? jrow.get("CQI_CDF_05").toString() : "0"));
            CDFrow.createCell(13).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_06") ? jrow.get("CQI_CDF_06").toString() : "0"));
            CDFrow.createCell(14).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_07") ? jrow.get("CQI_CDF_07").toString() : "0"));
            CDFrow.createCell(15).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_08") ? jrow.get("CQI_CDF_08").toString() : "0"));
            CDFrow.createCell(16).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_09") ? jrow.get("CQI_CDF_09").toString() : "0"));
            CDFrow.createCell(17).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_10") ? jrow.get("CQI_CDF_10").toString() : "0"));
            CDFrow.createCell(18).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_11") ? jrow.get("CQI_CDF_11").toString() : "0"));
            CDFrow.createCell(19).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_12") ? jrow.get("CQI_CDF_12").toString() : "0"));
            CDFrow.createCell(20).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_13") ? jrow.get("CQI_CDF_13").toString() : "0"));
            CDFrow.createCell(21).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_14") ? jrow.get("CQI_CDF_14").toString() : "0"));
            CDFrow.createCell(22).setCellValue(Double
                    .parseDouble(jrow.containsKey("CQI_CDF_15") ? jrow.get("CQI_CDF_15").toString() : "0"));
            i++;
        }

        String writeFolderPath = (String) super.properties.get("TEMP_FOLDER_PATH");
        String tempFolder = "/" + UUID.randomUUID().toString();
        String xlsFileName = "/DownLinkCQI(PDF_CDF).xls";

        if (!(new File(writeFolderPath + tempFolder)).mkdir()) {
            throw new Exception("? ??  .");
        }

        String xlsFileFullPath = writeFolderPath + tempFolder + xlsFileName;
        fileOut = new FileOutputStream(xlsFileFullPath);
        wb.write(fileOut);

        this.msg = "? ? ?";
        this.status = "SUCCESS";
        this.downloadurl = "download" + tempFolder + xlsFileName;

    } catch (Exception e) {
        this.msg = e.getMessage();
        this.status = "ERROR";
        this.error = true;
        if (session != null) {
            session.rollback();
        }
        e.printStackTrace();
    } finally {
        try {
            if (fileOut != null)
                fileOut.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (session != null) {
            session.close();
        }
    }

    this.log.debug("selectDailyCellTrafficCQIExcelDownload End");
    return SUCCESS;
}

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

private void makeTrafficSheet(Workbook wb, String safeName, Map map) {
    //sheet /* w ww  .  j ava  2s.  co  m*/
    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 createCellTrafficStatsCQIExcelSheet(Sheet sheet, String type, String searchType,
        Map<String, Object> map) throws Exception {

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

    //header ?//from   ww  w  .j a  v  a2s. c  o  m
    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("");
    hrow0.createCell(a++).setCellValue(type + "#00");
    hrow0.createCell(a++).setCellValue(type + "#01");
    hrow0.createCell(a++).setCellValue(type + "#02");
    hrow0.createCell(a++).setCellValue(type + "#03");
    hrow0.createCell(a++).setCellValue(type + "#04");
    hrow0.createCell(a++).setCellValue(type + "#05");
    hrow0.createCell(a++).setCellValue(type + "#06");
    hrow0.createCell(a++).setCellValue(type + "#07");
    hrow0.createCell(a++).setCellValue(type + "#08");
    hrow0.createCell(a++).setCellValue(type + "#09");
    hrow0.createCell(a++).setCellValue(type + "#10");
    hrow0.createCell(a++).setCellValue(type + "#11");
    hrow0.createCell(a++).setCellValue(type + "#12");
    hrow0.createCell(a++).setCellValue(type + "#13");
    hrow0.createCell(a++).setCellValue(type + "#14");
    hrow0.createCell(a++).setCellValue(type + "#15");

    ArrayList list01 = (ArrayList) map.get("rows");
    Iterator iterator = (Iterator) list01.iterator();
    short i = 1;
    while (iterator.hasNext()) {
        StringMap jrow = (StringMap) iterator.next();
        //  
        Row row = sheet.createRow((short) i);
        row.setHeightInPoints(20);
        int b = 0;
        row.createCell(b++).setCellValue((String) jrow.get("YMD"));
        if (searchType.equalsIgnoreCase("BONBU") || searchType.equalsIgnoreCase("CITY")) {
            row.createCell(b++).setCellValue((String) jrow.get("TITLE01"));
        } else if (searchType.equalsIgnoreCase("TEAM") || searchType.equalsIgnoreCase("UNI")
                || searchType.equalsIgnoreCase("EMS")) {
            row.createCell(b++).setCellValue((String) jrow.get("TITLE01"));
            row.createCell(b++).setCellValue((String) jrow.get("TITLE02"));
        } else if (searchType.equalsIgnoreCase("PART")) {
            row.createCell(b++).setCellValue((String) jrow.get("TITLE01"));
            row.createCell(b++).setCellValue((String) jrow.get("TITLE02"));
            row.createCell(b++).setCellValue((String) jrow.get("TITLE03"));
        }
        row.createCell(b++).setCellValue((String) jrow.get("FREQ_KIND"));
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_00");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_01");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_02");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_03");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_04");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_05");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_06");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_07");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_08");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_09");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_10");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_11");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_12");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_13");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_14");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_15");

        i++;
    }

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

}

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 ?/*  w  w w .  j ava  2 s .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.DownLinkByNMSStatsAction.java

public String selectCellTrafficStatsHistogramExcelDownload() {

    this.log.debug("selectCellTrafficStatsHistogramExcelDownload Start");
    SqlSession session = null;//from  w w w.  jav  a2 s. c o m
    FileOutputStream fileOut = null;

    try {
        //parseParam();
        Type type = new TypeToken<Map<String, Object>>() {
        }.getType();
        Gson gson = new Gson();
        Map<String, Object> map = gson.fromJson(this.JSONDATA, type);

        log.debug("json data : " + this.JSONDATA);

        Workbook wb = new HSSFWorkbook();
        //CreationHelper createHelper = wb.getCreationHelper();

        String sheetName = this.FROMYMD + "~" + this.TOYMD;
        String safeName = WorkbookUtil.createSafeSheetName(sheetName);

        //sheet 
        Sheet sheet = wb.createSheet(safeName);

        //header ?
        Row hrow0 = sheet.createRow((short) 0);
        hrow0.setHeightInPoints(20);
        hrow0.createCell(0).setCellValue("MBPS");
        hrow0.createCell(1).setCellValue("COUNT");
        hrow0.createCell(2).setCellValue("??");
        hrow0.createCell(3).setCellValue("CDF");

        StringMap categoryVal = (StringMap) map.get("categoryVal");
        StringMap rVal = (StringMap) map.get("rVal");
        StringMap rate = (StringMap) map.get("rate");
        StringMap cdf = (StringMap) map.get("cdf");

        short i = 1;
        for (int j = 0; j < 10; j++) {
            //  
            Row row = sheet.createRow((short) i);
            row.setHeightInPoints(20);
            row.createCell(0).setCellValue(Double.parseDouble(categoryVal.get(String.valueOf(j)).toString()));
            row.createCell(1).setCellValue(Double.parseDouble(rVal.get(String.valueOf(j)).toString()));
            row.createCell(2).setCellValue(Double.parseDouble(rate.get(String.valueOf(j)).toString()));
            row.createCell(3).setCellValue(Double.parseDouble(cdf.get(String.valueOf(j)).toString()));
            i++;
        }

        log.debug("selectCellTrafficStatsHistogramExcelDownload : file start");

        String writeFolderPath = (String) super.properties.get("TEMP_FOLDER_PATH");
        String tempFolder = "/" + UUID.randomUUID().toString();
        String xlsFileName = "/DownLinkStatsHistogram(NMS).xls";

        if (!(new File(writeFolderPath + tempFolder)).mkdir()) {
            throw new Exception("? ??  .");
        }

        String xlsFileFullPath = writeFolderPath + tempFolder + xlsFileName;
        fileOut = new FileOutputStream(xlsFileFullPath);
        wb.write(fileOut);
        log.debug("selectCellTrafficStatsHistogramExcelDownload : file end");

        this.msg = "? ? ?";
        this.status = "SUCCESS";
        this.downloadurl = "download" + tempFolder + xlsFileName;

    } catch (Exception e) {
        this.msg = e.getMessage();
        this.status = "ERROR";
        this.error = true;
        if (session != null) {
            session.rollback();
        }
        e.printStackTrace();
    } finally {
        try {
            if (fileOut != null)
                fileOut.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (session != null) {
            session.close();
        }
    }

    this.log.debug("selectCellTrafficStatsHistogramExcelDownload End");
    return SUCCESS;
}

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

public String selectCellTrafficStatsThrpCompGraphExcelDownload() {

    this.log.debug("selectCellTrafficStatsThrpCompGraphExcelDownload Start");
    SqlSession session = null;// w ww  .j a v  a 2s  . co  m
    FileOutputStream fileOut = null;

    try {
        //parseParam();
        Type type = new TypeToken<Map<String, Object>>() {
        }.getType();
        Gson gson = new Gson();
        Map<String, Object> map = gson.fromJson(this.JSONDATA, type);

        log.debug("json data : " + this.JSONDATA);

        Workbook wb = new HSSFWorkbook();
        //CreationHelper createHelper = wb.getCreationHelper();

        String sheetName = " ?";
        String safeName = WorkbookUtil.createSafeSheetName(sheetName);

        //sheet 
        Sheet sheet = wb.createSheet(safeName);

        //header ?
        Row hrow0 = sheet.createRow((short) 0);
        hrow0.setHeightInPoints(20);
        hrow0.createCell(0).setCellValue("");
        hrow0.createCell(1).setCellValue("(" + this.FROMYMD + ")");
        hrow0.createCell(2).setCellValue("(" + this.TOYMD + ")");

        StringMap categories = (StringMap) map.get("categories");
        StringMap beforeSeries = (StringMap) map.get("beforeSeries");
        StringMap afterSeries = (StringMap) map.get("afterSeries");

        short i = 1;
        for (int j = 0; j < categories.size(); j++) {
            //  
            Row row = sheet.createRow((short) i);
            row.setHeightInPoints(20);
            row.createCell(0)
                    .setCellValue(categories.get(String.valueOf(j)).toString().replaceAll("<br>", " : "));
            row.createCell(1).setCellValue(Double.parseDouble(beforeSeries.get(String.valueOf(j)).toString()));
            row.createCell(2).setCellValue(Double.parseDouble(afterSeries.get(String.valueOf(j)).toString()));
            i++;
        }

        log.debug("selectCellTrafficStatsThrpCompGraphExcelDownload : file start");

        String writeFolderPath = (String) super.properties.get("TEMP_FOLDER_PATH");
        String tempFolder = "/" + UUID.randomUUID().toString();
        String xlsFileName = "/DownLinkStatsThrpCompGraph(NMS).xls";

        if (!(new File(writeFolderPath + tempFolder)).mkdir()) {
            throw new Exception("? ??  .");
        }

        String xlsFileFullPath = writeFolderPath + tempFolder + xlsFileName;
        fileOut = new FileOutputStream(xlsFileFullPath);
        wb.write(fileOut);
        log.debug("selectCellTrafficStatsThrpCompGraphExcelDownload : file end");

        this.msg = "? ? ?";
        this.status = "SUCCESS";
        this.downloadurl = "download" + tempFolder + xlsFileName;

    } catch (Exception e) {
        this.msg = e.getMessage();
        this.status = "ERROR";
        this.error = true;
        if (session != null) {
            session.rollback();
        }
        e.printStackTrace();
    } finally {
        try {
            if (fileOut != null)
                fileOut.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (session != null) {
            session.close();
        }
    }

    this.log.debug("selectCellTrafficStatsThrpCompGraphExcelDownload End");
    return SUCCESS;
}

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

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

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

    String[] CQINAME = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" };
    if (MFC_CD.equals("MFC00002")) {
        CQINAME[0] = "1";
        CQINAME[1] = "2";
        CQINAME[2] = "3";
        CQINAME[3] = "4";
        CQINAME[4] = "5";
        CQINAME[5] = "6";
        CQINAME[6] = "7";
        CQINAME[7] = "8";
        CQINAME[8] = "9";
        CQINAME[9] = "10";
        CQINAME[10] = "11";
        CQINAME[11] = "12";
        CQINAME[12] = "13";
        CQINAME[13] = "14";
        CQINAME[14] = "15";
        CQINAME[15] = "16";
    }//from  ww w .  jav  a 2s.  c o m

    //header ?
    Row hrow0 = sheet.createRow((short) 0);
    hrow0.setHeightInPoints(20);
    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(type + "-" + CQINAME[0]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[1]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[2]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[3]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[4]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[5]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[6]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[7]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[8]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[9]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[10]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[11]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[12]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[13]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[14]);
    hrow0.createCell(a++).setCellValue(type + "-" + CQINAME[15]);

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

        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_00");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_01");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_02");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_03");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_04");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_05");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_06");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_07");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_08");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_09");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_10");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_11");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_12");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_13");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_14");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_15");

        i++;
    }

    this.log.debug("createCellTrafficCQIExcelSheet 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);
    int a = 0;/*from w  w  w  . j  a  v a2s.  co m*/
    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.DownLinkByQMSAction.java

public String selectCellTrafficHistogramExcelDownload() {

    this.log.debug("selectCellTrafficHistogramExcelDownload Start");
    SqlSession session = null;/* w ww  .j a va2s  .com*/
    FileOutputStream fileOut = null;

    try {
        //parseParam();
        Type type = new TypeToken<Map<String, Object>>() {
        }.getType();
        Gson gson = new Gson();
        Map<String, Object> map = gson.fromJson(this.JSONDATA, type);

        log.debug("json data : " + this.JSONDATA);

        Workbook wb = new HSSFWorkbook();
        //CreationHelper createHelper = wb.getCreationHelper();

        String sheetName = this.FROMYMD + "~" + this.TOYMD;
        String safeName = WorkbookUtil.createSafeSheetName(sheetName);

        //sheet 
        Sheet sheet = wb.createSheet(safeName);

        //header ?
        Row hrow0 = sheet.createRow((short) 0);
        hrow0.setHeightInPoints(20);
        hrow0.createCell(0).setCellValue("MBPS");
        hrow0.createCell(1).setCellValue("COUNT");
        hrow0.createCell(2).setCellValue("??");
        hrow0.createCell(3).setCellValue("CDF");

        StringMap categoryVal = (StringMap) map.get("categoryVal");
        StringMap rVal = (StringMap) map.get("rVal");
        StringMap rate = (StringMap) map.get("rate");
        StringMap cdf = (StringMap) map.get("cdf");

        short i = 1;
        for (int j = 0; j < 10; j++) {
            //  
            Row row = sheet.createRow((short) i);
            row.setHeightInPoints(20);
            row.createCell(0).setCellValue(Double.parseDouble(categoryVal.get(String.valueOf(j)).toString()));
            row.createCell(1).setCellValue(Double.parseDouble(rVal.get(String.valueOf(j)).toString()));
            row.createCell(2).setCellValue(Double.parseDouble(rate.get(String.valueOf(j)).toString()));
            row.createCell(3).setCellValue(Double.parseDouble(cdf.get(String.valueOf(j)).toString()));
            i++;
        }

        log.debug("selectCellTrafficHistogramExcelDownload : file start");

        String writeFolderPath = (String) super.properties.get("TEMP_FOLDER_PATH");
        String tempFolder = "/" + UUID.randomUUID().toString();
        String xlsFileName = "/DownLinkHistogram(QMS).xls";

        if (!(new File(writeFolderPath + tempFolder)).mkdir()) {
            throw new Exception("? ??  .");
        }

        String xlsFileFullPath = writeFolderPath + tempFolder + xlsFileName;
        fileOut = new FileOutputStream(xlsFileFullPath);
        wb.write(fileOut);
        log.debug("selectCellTrafficHistogramExcelDownload : file end");

        this.msg = "? ? ?";
        this.status = "SUCCESS";
        this.downloadurl = "download" + tempFolder + xlsFileName;

    } catch (Exception e) {
        this.msg = e.getMessage();
        this.status = "ERROR";
        this.error = true;
        if (session != null) {
            session.rollback();
        }
        e.printStackTrace();
    } finally {
        try {
            if (fileOut != null)
                fileOut.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (session != null) {
            session.close();
        }
    }

    this.log.debug("selectCellTrafficHistogramExcelDownload End");
    return SUCCESS;
}

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

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

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

    //header ?/*ww  w . j a v  a2 s.  co m*/
    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("");
    hrow0.createCell(a++).setCellValue(type + "#00");
    hrow0.createCell(a++).setCellValue(type + "#01");
    hrow0.createCell(a++).setCellValue(type + "#02");
    hrow0.createCell(a++).setCellValue(type + "#03");
    hrow0.createCell(a++).setCellValue(type + "#04");
    hrow0.createCell(a++).setCellValue(type + "#05");
    hrow0.createCell(a++).setCellValue(type + "#06");
    hrow0.createCell(a++).setCellValue(type + "#07");
    hrow0.createCell(a++).setCellValue(type + "#08");
    hrow0.createCell(a++).setCellValue(type + "#09");
    hrow0.createCell(a++).setCellValue(type + "#10");
    hrow0.createCell(a++).setCellValue(type + "#11");
    hrow0.createCell(a++).setCellValue(type + "#12");
    hrow0.createCell(a++).setCellValue(type + "#13");
    hrow0.createCell(a++).setCellValue(type + "#14");
    hrow0.createCell(a++).setCellValue(type + "#15");

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

        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_00");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_01");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_02");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_03");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_04");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_05");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_06");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_07");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_08");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_09");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_10");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_11");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_12");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_13");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_14");
        setCellDoubleIfExistValue(row.createCell(b++), jrow, "CQI_" + type + "_15");

        i++;
    }

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

}