/** * 业务数据类型生成 * * @param wb excel工作页 * @param btList 模型对象数组 */ public void BusTypeWriter(HSSFWorkbook wb, List<PDMBusinessDataType> btList) { HSSFSheet sheet = wb.getSheet(BT_SHEET); for (int i = 0; i < btList.size(); i++) { HSSFRow row = sheet.createRow(i + 2); PDMBusinessDataType bt = btList.get(i); // 1 HSSFCell cell = row.createCell(1); cell.setCellValue(bt.getTypeName()); cell.setCellStyle(getTextStyle(wb)); // 2 cell = row.createCell(2); cell.setCellValue(bt.getTypeChineseName()); cell.setCellStyle(getTextStyle(wb)); // 3 cell = row.createCell(3); cell.setCellValue(bt.getStandardTypeName()); cell.setCellStyle(getTextStyle(wb)); // 4 cell = row.createCell(4); cell.setCellValue(bt.getLength()); cell.setCellStyle(getTextStyle(wb)); // 5 cell = row.createCell(5); cell.setCellValue(bt.getPrecision()); cell.setCellStyle(getTextStyle(wb)); // 6 cell = row.createCell(6); cell.setCellValue(bt.getDefaultValue()); cell.setCellStyle(getTextStyle(wb)); // 7 cell = row.createCell(7); cell.setCellValue(bt.getComment()); cell.setCellStyle(getTextStyle(wb)); } }