package com.cw.common;

import org.apache.poi.hssf.usermodel.*;
import java.io.FileOutputStream;
 
public class PoiTest {

	public static void main(String[] args) throws Exception {

		FileOutputStream fos = new FileOutputStream("e:\\a.xls");
		HSSFWorkbook wb = new HSSFWorkbook();
		HSSFSheet s = wb.createSheet();
		wb.setSheetName(0, "Matrix");
		for (short i = 0; i < 50; i++) {
			HSSFRow row = s.createRow(i);
			for (short j = 0; j < 50; j++) {
				HSSFCell cell = row.createCell(j);
				cell.setCellValue("" + i + "," + j);
			}
		}
		wb.write(fos);
		fos.close();
	}
}

评论
发表评论

您还没有登录,请登录后发表评论

weiweichen1985
搜索本博客
我的相册
E6c390da-d0cb-3350-97d4-83ec6586912c-thumb
2008-6-26
共 122 张
存档
最新评论