public static void exportToExcel_poi(String[] title, String[][] dataList,
OutputStream os)
{
int k = -1;
HSSFWorkbook wwb = null;
try
{
wwb = new HSSFWorkbook();
HSSFSheet ws = null;
HSSFRow row = null;
HSSFCell cell = null;
for (int i = 0; i < dataList.length; i++)
{
if (i / 10000 > k)
{
k = i / 10000;
ws = wwb.createSheet("Sheet" + k);
row = ws.createRow(0);
for (int l = 0; l < title.length; l++)
{
cell = row.createCell((short) l);
cell.setCellValue(new HSSFRichTextString(title[l]));
}
}
for (int j = 0; j < dataList[i].length; j++)
{
row = ws.createRow(i - 10000 * k + 1);
cell = row.createCell((short) j);
cell.setCellValue(new HSSFRichTextString(dataList[i][j]));
}
}
wwb.write(os);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
os.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}