imageFormat = ImageFormat.PNG;
}
final String filename = FileHelper.createSafeFilename(getData().getName(), suffix, 50, true);
final byte[] content;
if (imageFormat != null) {
final Document document = ganttChart.create();
content = BatikImageRenderer.getByteArray(document, ganttChart.getWidth(), imageFormat);
DownloadUtils.setDownloadTarget(content, filename);
} else {
final MimeType type;
if (GanttChartEditForm.EXPORT_MS_PROJECT_MPX.equals(exportFormat) == true) {