ByteArrayOutputStream output = new ByteArrayOutputStream();
try {
Exporter exporter = setup();
ExporterInput exporterInput = SimpleExporterInput.getInstance(printList);
exporter.setExporterInput(exporterInput);
ExporterOutput exporterOutput = getExporterOutput(output);
exporter.setExporterOutput(exporterOutput);
ExporterConfiguration exporterConfiguration = getExporterConfiguration();
if (exporterConfiguration != null)
exporter.setConfiguration(exporterConfiguration);
ReportExportConfiguration reportConfiguration = getReportConfiguration();
if (reportConfiguration != null)
exporter.setConfiguration(reportConfiguration);
exporter.exportReport();
Flushables.flushQuietly(output);
return output.toByteArray();
} catch (JRException e) {
throw new RuntimeException(e);