Hi, The code "exporter.setParameter(JRExporterParameter.OUTPUT_FILE, reportName);" is setting the file to a parameter. If the file does not exist, it will throw classcast exception, as the code will be something like destFile = (File)parameters.get(JRExporterParameter.OUTPUT_FILE); here the values in the RExporterParameter.OUTPUT_FILE is cast to File.if myRtfReport.rtf does not exist exception is thrown hope this helps. Sonata software Limited