If you have no idea what I'm talking about, you should first dig into JasperReports. JasperReports is a powerful open source Java reporting tool that has the ability to deliver rich content onto the screen, to the printer or into PDF, HTML, XLS, CSV and XML files but this how-to will not learn you how to develop these reports so check their site out. I'd also highly suggest to get the iReport designer.
... TestDataSource dataSource = new TestDataSource(testObject); Map parameters = new HashMap(); parameters.put("parameterName", parameter); ReportManager.generateReport("/net/sf/jzeno/jasper/test.jasper", dataSource, parameters, ReportManager.PDF, "filenameWithoutExtension"); ...