poi(1)

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]);

}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章