public Resource equipmentListFileDownload(List<HtmlToEquipmentVO> htevo) {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = null;
XSSFRow row = null;
XSSFCell cell = null;
XSSFFont header_font = null;
XSSFFont body_font = null;
CellStyle header_style = null;
CellStyle body_style = null;
int equipment_list_row_no = 0;
sheet = wb.createSheet("장비 목록");
for(int i=0;i<9;i++) {
sheet.setColumnWidth(i, (sheet.getColumnWidth(i)+(short)2048));
}
//header font
header_font = wb.createFont();
header_font.setFontHeightInPoints((short) 20);
header_font.setBold(true);
//header cell style
header_style = wb.createCellStyle();
header_style.setFont(header_font);
header_style.setAlignment(HorizontalAlignment.CENTER);
//0행 헤더설정
sheet.addMergedRegion(new CellRangeAddress(0,0,0,8));
row = sheet.createRow(equipment_list_row_no++);
cell = row.createCell(0);
cell.setCellStyle(header_style);
cell.setCellValue("장비 목록");
//본문 컬럼 font 설정
body_font = wb.createFont();
body_font.setFontHeightInPoints((short) 12);
body_font.setBold(true);
//본문 컬럼 cell 스타일
body_style = wb.createCellStyle();
body_style.setFont(body_font);
body_style.setAlignment(HorizontalAlignment.CENTER);
body_style.setBorderTop(BorderStyle.THIN);
body_style.setBorderBottom(BorderStyle.THIN);
body_style.setBorderLeft(BorderStyle.THIN);
body_style.setBorderRight(BorderStyle.THIN);
body_style.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
body_style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
//1행 컬럼명 설정
row = sheet.createRow(equipment_list_row_no++);
//1행 0번째 제조사
cell = row.createCell(0);
cell.setCellStyle(body_style);
cell.setCellValue("제조사");
//1행 1번째 매입처
cell = row.createCell(1);
cell.setCellStyle(body_style);
cell.setCellValue("매입처");
//1행 2번째 솔루션
cell = row.createCell(2);
cell.setCellStyle(body_style);
cell.setCellValue("솔루션");
//1행 3번째 모델
cell = row.createCell(3);
cell.setCellStyle(body_style);
cell.setCellValue("모델");
//1행 4번째 S/N
cell = row.createCell(4);
cell.setCellStyle(body_style);
cell.setCellValue("S/N");
//1행 5번째 선적일
cell = row.createCell(5);
cell.setCellStyle(body_style);
cell.setCellValue("선적일");
//1행 6번째 입고일
cell = row.createCell(6);
cell.setCellStyle(body_style);
cell.setCellValue("입고일");
//1행 7번째 보관창구
cell = row.createCell(7);
cell.setCellStyle(body_style);
cell.setCellValue("보관창구");
//1행 8번째 사용유무
cell = row.createCell(8);
cell.setCellStyle(body_style);
cell.setCellValue("사용유무");
for(HtmlToEquipmentVO vo:htevo) {
row = sheet.createRow(equipment_list_row_no++);
//제조사
cell = row.createCell(0);
cell.setCellValue(vo.getEquipment_b());
//매입처
cell = row.createCell(1);
cell.setCellValue(vo.getEquipment_c());
//솔루션
cell = row.createCell(2);
cell.setCellValue(vo.getEquipment_d());
//모델
cell = row.createCell(3);
cell.setCellValue(vo.getEquipment_e());
//S/N
cell = row.createCell(4);
cell.setCellValue(vo.getEquipment_f());
//선적일
cell = row.createCell(5);
cell.setCellValue(vo.getEquipment_g());
//입고일
cell = row.createCell(6);
cell.setCellValue(vo.getEquipment_h());
//보관창구
cell = row.createCell(7);
cell.setCellValue(vo.getEquipment_i());
//사용유무
cell = row.createCell(8);
cell.setCellValue(vo.getEquipment_j());
}