/***
	 * д뵽EXCEL д뵥ݣ
	 * 
	 * @param xls_write_Address
	 * @param beanListAll
	 * @param sheetnames
	 * @throws IOException
	 */
	public void writeExcel2(InputStream input, String path,
			List<TMomExportTaskReportBean> beanListAll, int index)
			throws IOException {
		// int maxCount = 12;
		FileOutputStream output = new FileOutputStream(new File(path)); // ȡļ·
		// FileInputStream input = new FileInputStream(new
		// File(xls_write_Address));
		XSSFWorkbook wb = new XSSFWorkbook(input);// (new
		XSSFSheet sheet = wb.getSheetAt(0);
		int startRow = 2;
		int allCount = 0;
		for (int j = 0; j < beanListAll.size(); j++) {
			allCount++;
			int tempCont = beanListAll.get(j).getFileName() == null ? 1
					: beanListAll.get(j).getFileName().length;
			insertRow(sheet, 4, 1);
			for (int w = 1; w < tempCont; w++) {
				insertRow(sheet, 4, 1);
			}
		}
		int totleCount = 0;
		for (int i = 0; i < beanListAll.size(); i++) {
			TMomExportTaskReportBean bean = beanListAll.get(i);

			XSSFRow row = null;
			int isUper = bean.getFileName() == null ? 1
					: bean.getFileName().length;
			for (int t = 0; t < isUper; t++) {
				Boolean isCreat = false;
				if ((i + t + startRow) > sheet.getLastRowNum()) {
					row = sheet.createRow(i + t + startRow);
					isCreat = true;
				} else {
					row = sheet.getRow(i + t + startRow);
					isCreat = false;
				}

				totleCount++;
				for (int cols = 0; cols < 7; cols++) {
					XSSFCell cell = null;
					if (isCreat) {
						cell = row.createCell(cols);
					} else {
						cell = row.getCell(cols);
					}

					cell.setCellType(XSSFCell.CELL_TYPE_STRING);// ıʽ

					switch (cols) {

					case 0:
						cell.setCellValue(totleCount + "");// д
						break;
					case 1:
						cell.setCellValue(bean.getName());// д
						break;
					case 2:
						cell.setCellValue(bean.getFileName()[t].getFileName());// д
						if (bean.isMustNode()
								&& bean.getFileName()[t].getFileName().trim()
										.isEmpty()) {
							XSSFCellStyle my_style = wb.createCellStyle();

							// We will now specify a background cell color */
							my_style.setFillPattern(XSSFCellStyle.FINE_DOTS);
							// my_style.setFillForegroundColor(IndexedColors.BLUE
							// .getIndex());
							my_style.setFillBackgroundColor(IndexedColors.RED
									.getIndex());
							cell.setCellStyle(my_style);
						}
						System.out.println(bean.toString());
						break;
					case 3:
						cell.setCellValue(bean.getFileName()[t].getPersion());// д
						break;
					case 4:
						cell.setCellValue(bean.getFinishDate());// д
						break;
					case 5:
						cell.setCellValue(bean.getFileName()[t]
								.getActureFinishDate());// д
						break;
					case 6:
						cell.setCellValue(bean.getFileName()[t].getState());// д
						break;

					default:
						break;
					}
				}
				bean.setName("");
				// bean.setActureFinishDate("");
				// bean.setFinishDate("");
				// bean.setPersion("");
				// bean.setState("");

			}
		}
		// }
		wb.write(output);
		output.close();
		input.close();
		System.out.println("-------WRITE EXCEL OVER-------");
	}
