final File reportFile = new File(context.getRealPath("/reports/WebappReport.jasper"));
final Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("BaseDir", new File(context.getRealPath("/reports")));
JRResource pdfResource = new JRConcreteResource<PdfResourceHandler>(reportFile,
new PdfResourceHandler()).setReportParameters(parameters).setReportDataSource(
new WebappDataSource());
add(new ResourceLink<Void>("linkToPdf", pdfResource));
JRResource rtfResource = new JRConcreteResource<RtfResourceHandler>(reportFile,
new RtfResourceHandler()).setReportParameters(parameters).setReportDataSource(
new WebappDataSource());
add(new ResourceLink<Void>("linkToRtf", rtfResource));
JRResource htmlResource = new JRConcreteResource<HtmlResourceHandler>(reportFile,
new HtmlResourceHandler()).setReportParameters(parameters).setReportDataSource(
new WebappDataSource());
add(new ResourceLink<Void>("linkToHtml", htmlResource));
JRResource textResource = new JRConcreteResource<TextResourceHandler>(reportFile,
new TextResourceHandler()).setReportParameters(parameters).setReportDataSource(
new WebappDataSource());
add(new ResourceLink<Void>("linkToText", textResource));
JRResource imageResource = new JRImageResource(reportFile).setReportParameters(parameters)
.setReportDataSource(new WebappDataSource());
add(new ResourceLink<Void>("linkToImage", imageResource));
JRResource csvResource = new JRConcreteResource<CsvResourceHandler>(reportFile,
new CsvResourceHandler()).setReportParameters(parameters).setReportDataSource(
new WebappDataSource());
add(new ResourceLink<Void>("linkToCsv", csvResource));
}