Open a report in JReport Designer. In the Report Inspector, select the node that represents the report tab and you will find the three Exit function properties: After Init Parameter, After Run and Before Run.
Reference: For API information, see JReport Javadoc jet.util package and jet.exception package in <install_root>\help\api
.