Please see jasper report, it is open source, I ever used it, its veryconvenient and easysee http://jasperreports.sourceforge.net/ it can generate excell file, csv,pdf, etc.