package cn.51crh.web;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.FileOutputStream;
import java.io.IOException;
public class excelmils {
public static void main(String[] args) throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet("sheet1");
for (int i = 0; i < 5520; i++) {
XSSFRow row = sheet.createRow(i);
XSSFCell cell = row.createCell(0);
// 给Excel的单元格设置样式和赋值
cell.setCellValue("第?行"+i);
FileOutputStream os = new FileOutputStream("d:\\workbook.xlsx");
wb.write(os);
os.close();
}
}
}