use of com.autentia.tnt.report.ReportGeneratorStandardImpl in project TNTConcept by autentia.
the class ReportServlet method generateReport.
private void generateReport(HttpServletRequest request, HttpServletResponse response, String reportName, String ext, String reportCategory) throws IOException {
ReportInfoBuilder builder = new ReportInfoBuilder();
builder.name(reportName).in(ReportFormat.valueOf(ext)).withCategory(reportCategory);
Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
String arg = (String) e.nextElement();
final String value = request.getParameter(arg);
builder.andParameter(arg, value);
}
ReportGeneratorStandardImpl generator = new ReportGeneratorStandardImpl();
try {
generator.generate(builder.build(), response.getOutputStream());
} catch (ReportException e1) {
log.error(e1);
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e1.getMessage());
}
response.setContentType(ReportFormat.valueOf(ext).getResponseType());
}
Aggregations