Jump to content
We've recently updated our Privacy Statement, available here ×

Exporting into .RTF file


frafel

Recommended Posts

Hi!

 

I am starting to use jasperreport engine (using iReport as painter) and I enjoied to see how it work. I created a first simple report using a query to my DB and I produced easily a .PDF and also a .HTML output.

 

But I am interested to obtain a .RTF file and I was unable to realize it because I don't found an appropriate method in the JasperExportManager class; I have seen that there is an astract class (JRRtfExporter) and probably I need to extend that class to solve my need, but unfortunately I am novice in Java and I am not yet able to do this job; so can anyone suggest a snipped of code or a place where I

can find it to obtain what I need? Or alternatively what I must study to produce my first .RTF file with the report?

 

Thank very much. Franco in Italy

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

it is something like this:

 

Code:

exporter = new JRRtfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "Report.rtf"«»);
exporter.exportReport();

 

this also works for xls, csv, txt and xml similar... if you use this way also for pdf or html, there exists some specific parameter, you can set.... for example:

Code:
[code]
exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, ";"«»);
exporter.setParameter(JRCsvExporterParameter.RECORD_DELIMITER, "n"«»);

the field and record delimiter for the csv file...

 

have fun !

Post edited by: wegnerk, at: 2006/09/04 08:46

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...