conradt
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forum
Events
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Downloads
Posts posted by conradt
-
-
I see - it must be
exporter.setParameter(JRExporterParameter.OUTPUT_FILE, new File(fileName)); -
Hi Lee,
i tried your code (using JR2.0.5 and iText1.4.5) but get the following exception:
Code: Exception in thread "main" java.lang.ClassCastException: java.lang.String
at net.sf.jasperreports.engine.export.JRRtfExporter.exportReport(JRRtfExporter.java:192)
at com.openjades.crm.documents.generator.CVGenerator.generate(CVGenerator.java:38)
at com.openjades.crm.documents.generator.CVGenerator.main(CVGenerator.java:23)CVGenerator.java:
Code: [code]
JasperPrint jPrint = JasperFillManager.fillReport(resourcesPath + "cv.jasper",new HashMap());
JRRtfExporter exporter = new JRRtfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE, outPath + "CV_1234.rtf"«»);
exporter.exportReport();Any idea what causes the ClassCastException?
Thanks.
JasperPrint to RTF
in Products
Posted
I see - it must be new File(fileName) instead of just fileName:
Post edited by: conradt, at: 2008/05/12 07:23