JasperReport - Text Export Error
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   yaddif_medina
Posted On:   Wednesday, June 28, 2006 11:26 AM

Hi all, I am working with JasperReport in my web application (generating pdf files) but now my client wants a Text file output. I have tried with the JRTextExporter but it generates just 12 blank lines in the txt file :( .. (I have tried with the rtf exporter and it gives me a blank file too)!!!. I am using the jasperreports-1.2.4.jar PLEASE HELP ME, because I am getting upset for this. My code is: JRTextExporter exporter = new JRTextExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "c:\borra1.txt"); exporter.setParameter(JRTextExporterParameter.CHARACTER_WIDTH,    More>>

Hi all,



I am working with JasperReport in my web application (generating pdf files) but now my client wants a Text file output. I have tried with the JRTextExporter but it generates just 12 blank lines in the txt file :( .. (I have tried with the rtf exporter and it gives me a blank file too)!!!.


I am using the jasperreports-1.2.4.jar


PLEASE HELP ME, because I am getting upset for this.


My code is:
JRTextExporter exporter = new JRTextExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "c:\borra1.txt");
exporter.setParameter(JRTextExporterParameter.CHARACTER_WIDTH, new Integer(200));
exporter.setParameter(JRTextExporterParameter.CHARACTER_HEIGHT, new Integer(50));
exporter.exportReport();


Thanks in advance,
Yaddif

   <<Less

Re: JasperReport - Text Export Error

Posted By:   Anonymous  
Posted On:   Thursday, July 6, 2006 10:54 AM

hello, i tried this myself a few times and had more success creating a File object and using




File myFile = new File("C:\test.txt");

exporter.setParameter(JRTextExporterParameter.OUTPUT_FILE, myFile);

exporter.exportReport();



with the file i created as the parameter. it seems that jasper reports' file creation and management is a little shabby, so if you let java handle it i imagine you'll have more success.



hope this helps
About | Sitemap | Contact