I am building a j2ee web application with a MySQL db. I need to whip up some reports, and slice and dice the data in various ways. Is it best to tackle each report requirement, write the code to serve up the data? Or, is there a framework I should look into?
Take a look at JasperReports (http://www.jasperforge.org). You can integrate it into your Java app or use it as a stand-alone reporting application along the same lines as Crystal Reports.
recommend ireport, a sub-project in JasperReports
http://jasperforge.org/plugins/project/project_home.php?projectname=ireport
It's hard to give a precise answer as you didn't give many details so I'd just suggest to have a look at JasperReport (and iReport), Eclipse Birt or Pentaho Report.
This thread will give you some information on the differences between them. Or Google a bit.
You might also want to look at Docmosis since you can do a lot of the work in the templates which are just doc or odf documents. You can't do everything in Docmosis but typical report stuff can be done faster little code.