`
hongbo.wu
  • 浏览: 92194 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

java 写Excel工具类

 
阅读更多
public static void main(String[] args)
	{
		File template = new File("c:/excel/t.xls");
		File targer = new File("c:/excel/t_" + new Date().getTime() + ".xls");

		try
		{
			ExcelWrite excelUtil = new ExcelWrite(targer, template);

			for (int i = 0; i < 3; i++)
			{
				Object[] arr = new Object[] { "1", 100.5, 1, 4+i, 1F };

				excelUtil.writeALine(i + 6, arr);
			}

			// excelUtil.write(10, 0, "1000.00");

			excelUtil.submitAndClose();

		}
		catch (ExcelException e)
		{
			e.printStackTrace();
		}

		System.out.println("success");
	}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics