package com.util;

import java.beans.PropertyDescriptor;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import com.opensymphony.xwork2.ActionContext;


public class WriteExcel {
	 public void getExcel(OutputStream  output){		
		try {					
		 //创建工作簿对象
			XSSFWorkbook wb = new XSSFWorkbook();			
			XSSFSheet sheet = wb.createSheet("test"); // sheet名称
			//创建行
			XSSFRow row = sheet.createRow(0); 
			row.createCell(0).setCellValue("哈哈哈");
			row.createCell(1).setCellValue("哈哈哈");
			row.createCell(2).setCellValue("哈哈哈");
			row.createCell(3).setCellValue("哈哈哈");
			row.createCell(4).setCellValue("哈哈哈");
			row.createCell(5).setCellValue("哈哈哈");
			
			output.flush(); 
	        wb.write(output); 
	        output.close();
		} catch (Exception e) {
			e.printStackTrace();
		}	
	}
	 
}
