//use ExcelReport to generate Excel report
ExcelReport excelReport = new ExcelReport();
outputStream = excelReport.generateExcelReport(jasperPrint);
} else if (reportType.equals("html")) {
// used HtmlReport to generate HTML report
HtmlReport htmlReport = new HtmlReport();
outputStream = htmlReport.generateHtmlReport(jasperPrint);
} else {
throw new ReportingException("requested report type " + reportType + " invalid");
}
} finally {
if (outputStream != null) {