use of org.finos.waltz.model.survey.SurveyQuestion in project waltz by khartec.
the class SurveyInstanceExtractor method mkCSVReport.
private byte[] mkCSVReport(List<SurveyQuestion> questions, List<List<Object>> reportRows) throws IOException {
List<String> headers = mkHeaderStrings(questions);
StringWriter writer = new StringWriter();
CsvListWriter csvWriter = new CsvListWriter(writer, CsvPreference.EXCEL_PREFERENCE);
csvWriter.write(headers);
reportRows.forEach(unchecked(row -> csvWriter.write(simplify(row))));
csvWriter.flush();
return writer.toString().getBytes();
}
Aggregations