ns69 Posted February 5, 2008 Share Posted February 5, 2008 Hi All, I am exporting the reports in various formats in my web application, but the word format has boxes around each report elements. It looks very weird. Anyone has encountered the same formatting issue? How to get rid of these lines from the report? Thanks in advance. Link to comment Share on other sites More sharing options...
ns69 Posted May 3, 2008 Author Share Posted May 3, 2008 Hi Teodar, As per your earlier response in the other thread, I am uploading the RTF file for your reference. Thanks,NS Link to comment Share on other sites More sharing options...
ns69 Posted May 3, 2008 Author Share Posted May 3, 2008 attachment [file name=test-17d2c6a68ac58c45a45eff280833c37b.zip size=83354]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/test-17d2c6a68ac58c45a45eff280833c37b.zip[/file] Link to comment Share on other sites More sharing options...
dnvsrikanth Posted May 5, 2008 Share Posted May 5, 2008 Hey Neeta, Did you observe whether these weird boders are appearing only in word format or whether they are appearing inall other formats??? DNV Srikanth Link to comment Share on other sites More sharing options...
ns69 Posted May 5, 2008 Author Share Posted May 5, 2008 Srikanth, The borders around the report elements appear only in the word format. The other formats are without any borders. Thanks,Neeta Link to comment Share on other sites More sharing options...
Teodor Danciu Posted May 6, 2008 Share Posted May 6, 2008 Hi, Can we also see the JRXML used to generated this report and can you tell use what version of JR are you using? Thank you,Teodor Link to comment Share on other sites More sharing options...
Teodor Danciu Posted May 6, 2008 Share Posted May 6, 2008 Hi, In any case, the RTF you attached is NOT the exact RTF output produced by JasperReports.I have looked into it, I have read the markup tags and that is not what JasperReports generates. I suspect you open the original RTF document generated by JR inside some RTF editor and you save it back. The resulting document is different from what JR has generated. Some sort of conversions take place, which introduce these borders. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
ns69 Posted May 6, 2008 Author Share Posted May 6, 2008 You are right the rtf file was opened by the word application and saved. Here is the rtf file generated by JR. You will also find the .jrxml file as attachment created in iReport. I have also included the java code for your review. Thanks,NS. Code: public static void genWordReport(JasperPrint jasperPrint, HttpServletResponse response, OutputStream ouputStream, String saveAsName){ try{ response.reset();// response.setHeader("Expires", "0"«»); //response.setHeader("Content-Disposition", "inline;filename=" + saveAsName.concat(".doc"«»)); response.setHeader("Content-Disposition", "attachment;filename=" + saveAsName.concat(".rtf"«»)); response.setContentType("application/ms-word"«»); response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0"«»); response.setHeader("Pragma", "public"«»); net.sf.jasperreports.engine.export.JRRtfExporter exporter = new net.sf.jasperreports.engine.export.JRRtfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, saveAsName.concat(".doc"«»)); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream); exporter.setParameter(JRExporterParameter.OFFSET_X, new Integer(20)); exporter.setParameter(JRExporterParameter.OFFSET_Y, new Integer(15)); exporter.exportReport(); } catch(Exception er){ String connectMsg = "Could not create the Word report " + er.getMessage() + " " + er.getLocalizedMessage(); System.out.println(connectMsg); } } [file name=testrep.zip size=25634]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/testrep.zip[/file] Link to comment Share on other sites More sharing options...
Teodor Danciu Posted May 6, 2008 Share Posted May 6, 2008 Hi, As you can see the RTF generated by JasperReports does not have any unwanted borders around the text fields. Any extra border you showed us is introduced by the MS Word editor when you save it. You should have told us so from the beginning that you edit the file in Word. It would have saved us time.Just as a curiosity, what version of MS Word is it? I consider this matter closed. This problem should be reported to Microsoft, as our RTF exporter fully complies with the RTF specifications (wrote by Microsoft themselves). Thanks,Teodor Link to comment Share on other sites More sharing options...
ns69 Posted May 6, 2008 Author Share Posted May 6, 2008 I am using MS Office Word 2003 SP3. As you can see from my code I am just initializing the response objrct content type to word application to open the .rtf file (created by JR) in the client browser window. Sorry for the confusion. Thanks a lot for all your help.Regards,Neeta Link to comment Share on other sites More sharing options...
suthakarm Posted September 24, 2008 Share Posted September 24, 2008 Hi,It looks like i'm having the similar issue. Please let me know how to resolve this issue?Thanks-S Link to comment Share on other sites More sharing options...
javaguy Posted November 4, 2008 Share Posted November 4, 2008 Hi all,I have tried with newest version of JasperReports (3.1.0) but I still get this problem. Please help me to resolve this.Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now