protected HtmlReportGenerator(ReportConfiguration reportConfiguration) {
super(reportConfiguration);
}
public void applyTemplate(Report report) throws IOException {
FreeMarkerTemplate template;
System.out.println();
System.out.println("****************************************************************************************");
System.out.println(" HTML REPORT GENERATOR IN USE!!!");
System.out.println(" Please disable in Production mode. This feature is a major performance drain!!");
System.out.println("****************************************************************************************");
System.out.println();
if(report instanceof DOMReport) {
template = new FreeMarkerTemplate("html/template-dom.html", HtmlReportGenerator.class);
} else {
template = new FreeMarkerTemplate("html/template-sax.html", HtmlReportGenerator.class);
}
Writer writer = getReportConfiguration().getOutputWriter();
Map templateModel = new HashMap();
templateModel.put("report", report);
templateModel.put("htmlEscape", new HtmlEscape());
writer.write(template.apply(templateModel));
}