/*** 按列写入Excel并设置格式
*
*@paramoutputUrl
* 输出路径
*@paramsheetName
* 工作薄名称
*@paramtitles
* 表头
*@paramarrayList
* 表头数据
*@throwsIOException
*@throwsRowsExceededException
*@throwsWriteException*/
public static voidwriteExcel(String outputUrl, String sheetName, String[] titlesArray,
ArrayList... arrayList) throwsIOException, RowsExceededException, WriteException {if (outputUrl == null || outputUrl.length() == 0) {
System.out.println("Param(s) Error:outputUrl is required and the length of outputUrl is required greater than 0.");return;
}int n =arrayList.length;if (titlesArray.length !=n) {
System.out.println("Param(s) Error:the titles' length is hoped to be equal to arrayList's length.");return;
}//创建Excel文件