if (PDF_FORMAT.equalsIgnoreCase(reportOutputType)) {
FileOutputStream out = new FileOutputStream(destination);
transformer.transformToPdf(reader, XHTML_TRANSFORM_LOCATION, out);
out.close();
} else {
ReportSpec spec = request.getReportSpec();
File xslFile = getXSLFile(spec.getXslTransforms());
if (xslFile != null) {
FileWriter out = new FileWriter(destination);
transformer.transformUsingXsl(reader, xslFile, out);
out.close();
}