String template = "#foreach ($row in $commons.asArray($metaData))$row.get()#if (!$row.isLast()),#end#end\r\n"
+ "\r\n"
+ "#foreach ($row in $results)\r\n"
+ "#foreach ($column in $commons.asArray($row))$commons.asExcel($column.get())#if (!$column.isLast()),#end#end \r\n"
+ "\r\n" + "#end ";
ContextAwareMap map = new ContextAware.ContextAwareMap("metaData", ResultSetWriter.extractMetaData(resultSet));
map.put("results", ResultSetWriter.extractResults(resultSet));
String output = VelocityParser.parseString(template, map);
FileUtils.writeFile(new File(received), output);
return received;
}