Get a resultSet and save on a file with a custom template