POIFSFileSystem fs =
new
POIFSFileSystem(
new
FileInputStream(
fileName));
HSSFWorkbook resourceFile =
new
HSSFWorkbook(fs);
HSSFSheet shOrg = resourceFile.getSheet(
"Sheet1"
);
if
(shOrg ==
null
) {
return
;
}
HSSFRow curRow = shOrg.getRow(
1
);
HSSFCell curCell = curRow.getCell(
0
);
HSSFCellStyle cellStyle = resourceFile.createCellStyle();
cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
cellStyle.setFillForegroundColor(HSSFColor.DARK_RED.index);
Font font = resourceFile.createFont();
font.setFontHeightInPoints((
short
)
24
);
font.setFontName(
"楷体"
);
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
font.setColor(HSSFColor.GREEN.index);
cellStyle.setFont(font);
curCell.setCellStyle(cellStyle);
String outputFileName =
"resource1.xls"
;
FileOutputStream stream;
stream =
new
FileOutputStream(
new
File(outputFileName));
resourceFile.write(stream);
stream.close();