public static bool DataToExecl(DataTable dtSource, string filePath)
        {
            IWorkbook wk = new HSSFWorkbook();
            ISheet sheet = (NPOI.HSSF.UserModel.HSSFSheet)wk.CreateSheet("元数据");
            for (int i = 0; i < dtSource.Rows.Count; i++)
            {
                IRow newrow = sheet.CreateRow(i);
                for (int j = 0; j < dtSource.Columns.Count; j++)
                {
                    ICell cell = newrow.CreateCell(j);
                    if (dtSource.Rows[i][j] != null && !string.IsNullOrEmpty(dtSource.Rows[i][j].ToString()))
                    {
                        cell.SetCellValue(dtSource.Rows[i][j].ToString());
                    }
                }
            }
            if (File.Exists(filePath))
            {
                File.Delete(filePath);
            }
            FileStream fs = File.Create(filePath);                    
            wk.Write(fs);
            fs.Close();
            return true;
        }