views:

202

answers:

1

I need to export a report and save it to a location specified, i have exported the report but i want to know how to save it in a file location, it is a doc or rtf format

A: 

Use

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, filename);
exporter.exportReport();

of your conrete JRExporter. jasperPrint is of course your JasperPrint, and filename is the name of the target file (including directory)

Bozho
Thank You for the answer, but it doesnt work, This is my codeexporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "F://sample.rtf");
stanley
is there any exception? or how exactly it doesn't work.
Bozho
I have fixed the problem, now it exports and saves in doc, Thank you
stanley
Since Jasper uses JRRTFExporter for saving doc files, Is there any way to convert rtf to doc , or must we set any headers to convert it in doc in jasper?
stanley
ask that as another question. (I don't know)
Bozho