// get the sheets from the given Format
final String styleSheet = "fo-styles/" + form.getExportFormat() + "/timesheet-template-fo.xsl";
final String xmlData = "fo-styles/" + form.getExportFormat() + "/timesheets2pdf.xml";
// get the formatter for the different export formats
final Formatter formatter = formatterFactory.getFormatter(form.getExportFormat());
final Integer taskId = filter.getTaskId();
final Map<String, Object> data = formatter.getData(timeSheets, taskId, getRequest(), getResponse(), filter);
// render the PDF with fop
final byte[] content = pdfRenderer.render(styleSheet, xmlData, data);
DownloadUtils.setDownloadTarget(content, filename);