JasperFillManager.fillReportToFile(String sourceFileName , Map parameters ,
The following Java class fills the report and saves it to disk:
public class FirstReportFill
public static void main(String args)
new HashMap(), new JREmptyDataSource());
catch (JRException e)
After executing the above class, we should have a file named FirstReport.
JRprint in the same location as our compiled report template, which was named
Viewing the Report
JasperReports includes a utility class, net.sf.jasperreports.view.JasperViewer ,
that we can use to view generated reports. As with the tool to preview designs, the
easiest way to use it is to wrap it into an ANT target. Again, this is the approach
taken by the samples included with JasperReports, and the approach taken by us
as well. Let us add a new target to our ANT build file. Following the conventions
established by the JasperReports samples, we will name this target view .