Java代码
@ApiOperation("下载模板")
@RequestMapping(value = "/modelExcel",method = RequestMethod.GET)
public void exportExcel(HttpServletRequest request, HttpServletResponse response) {
OutputStream ouputStream = null;
try {
// 创建新的Excel 工作簿
XSSFWorkbook workbook = new XSSFWorkbook();
// 新建工作表,其语句为:
XSSFSheet sheet = workbook.createSheet("sheet1");
sheet.setColumnWidth(0, 8000);
sheet.setColumnWidth(1, 5000);
sheet.setColumnWidth(2, 5000);
sheet.setColumnWidth(3, 5000);
// 声明"Sheet1"工作表的第一行表头信息
String[] tableHeader = new String[