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");
}
本文提供了一个Java程序示例,演示如何使用特定工具类批量写入Excel文件,并实现数据行的添加。示例中包含了文件路径设置、对象创建、循环写入等关键步骤。
6616

被折叠的 条评论
为什么被折叠?



