Which part are you having problems with - getting the data from the DB, creating an Excel file, streaming the file to the browser, or emailing the file to the user?
For creating an Excel file you can use a library like Apache POI or jExcelApi. You can't stream the file from a JSP, though, because JSPs can't handle binary content. You'll need to do this in a servlet.
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop