码迷,mamicode.com
首页 > 其他好文 > 详细

poi(1)

时间:2016-01-07 01:31:23      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:poi

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

String[] headers = {"column1","column2","column3", "column4", "column5", "column6", "column7"};

TimeStatistic time = new TimeStatistic();

time.start();

SXSSFWorkbook wb = new SXSSFWorkbook();

Sheet  sheet = wb.createSheet();

//styles

XSSFCellStyle  cellstyle = (XSSFCellStyle) wb.createCellStyle();

cellstyle.setFillForegroundColor(new XSSFColor(new Color(255,0,0)));

cellstyle.setFillPattern(CellStyle.SOLID_FOREGROUND);

//add headers

Row  row = sheet.createRow(0);

for(int i=0; i<headers.length; i++){

Cell cell = row.createCell(i);

cell.setCellStyle(cellstyle);

cell.setCellValue(headers[i]);

}

for(int i=0; i < 65536; i++){

row = sheet.createRow(i+1);

for(int j=0; j<headers.length; j++){

row.createCell(j).setCellValue(11111111);

}

}

FileOutputStream fileOut = new FileOutputStream("1.xlsx");

wb.write(fileOut);   

time.end();

System.out.println(time.time());

int hw[] = getStringWidth("中国");

System.out.println(hw[0] + "," + hw[1]);

}


poi(1)

标签:poi

原文地址:http://1129254.blog.51cto.com/1119254/1732213

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!