Loganathan Natarajan
asked on
French text display problem in JASPER report docs
Please help me regarding this problem
I use jasper report for report in my web project (Tomcat). I am saving the report in .rtf file and from java. Also, I read the text from iReport (jasper tool) and write it in the .doc/.rtf documents.
When the tomcat is in windows OS, the french texts in the .rtf report is displayed as well.
But If the tomcat is in Linux OS, the same french text is displayed with some changes
The Code for saving the report as .rtf
========================== ========== ===
JasperPrint jasperPrint = JasperManager.fillReport(j asperRepor t,paramete rs,c onn);
JRRtfExporter rtfExporter = new JRRtfExporter(); rtfExporter.setParameter(J RExporterP arameter.J ASPE R_PRINT, jasperPrint); rtfExporter.setParameter(J RExporterP arameter.O UTPU T_FILE_NAME,
request.getRealPath("inclu des")+"/re port.rtf") ;
rtfExporter.exportReport() ;
So now the report is saved as report.doc
And I read the document and display it. For that code is
========================== ========== ========== ==== ======
response.setHeader ("Content-Disposition", "attachment;filename="Repo rt.rtf"");
File f = new File("report.doc");
InputStream in = new FileInputStream(f);
ServletOutputStream outs = response.getOutputStream() ;
int bit = 256;
int i = 0;
try {
while ((bit) >= 0) {
bit = in.read();
outs.write(bit);
}
} catch (IOException ioe) {
ioe.printStackTrace(System .out);
}
outs.flush();
outs.close();
in.close();
************************** ********** *****
1) Do I need to map any font while i create doc/rtf reports? because in windows it is not a problem...
2) Accent problem is the main one in this .rtf/doc...how to overcome this when we create report?
I use jasper report for report in my web project (Tomcat). I am saving the report in .rtf file and from java. Also, I read the text from iReport (jasper tool) and write it in the .doc/.rtf documents.
When the tomcat is in windows OS, the french texts in the .rtf report is displayed as well.
But If the tomcat is in Linux OS, the same french text is displayed with some changes
The Code for saving the report as .rtf
==========================
JasperPrint jasperPrint = JasperManager.fillReport(j
JRRtfExporter rtfExporter = new JRRtfExporter(); rtfExporter.setParameter(J
request.getRealPath("inclu
rtfExporter.exportReport()
So now the report is saved as report.doc
And I read the document and display it. For that code is
==========================
response.setHeader ("Content-Disposition", "attachment;filename="Repo
File f = new File("report.doc");
InputStream in = new FileInputStream(f);
ServletOutputStream outs = response.getOutputStream()
int bit = 256;
int i = 0;
try {
while ((bit) >= 0) {
bit = in.read();
outs.write(bit);
}
} catch (IOException ioe) {
ioe.printStackTrace(System
}
outs.flush();
outs.close();
in.close();
**************************
1) Do I need to map any font while i create doc/rtf reports? because in windows it is not a problem...
2) Accent problem is the main one in this .rtf/doc...how to overcome this when we create report?
ASKER
i think it is transmission problem... because in normal word document also when i write french text.. it is not displaying correctly..
do we need to apply french fonts to display the french text in word doc???
but it works well in pdf docs..
do we need to apply french fonts to display the french text in word doc???
but it works well in pdf docs..
Are you viewing the file on the two different OSes as well?
I'm confused now...
So this works:
GENERATE(windows) -> SERVLET(windows) -> VIEW(windows)
Does this?
GENERATE(windows) -> SERVLET(windows) -> VIEW(linux)
Or are you saying that this doesn't work:
GENERATE(linux) -> SERVLET(linux) -> VIEW(windows)
?
I'm confused now...
So this works:
GENERATE(windows) -> SERVLET(windows) -> VIEW(windows)
Does this?
GENERATE(windows) -> SERVLET(windows) -> VIEW(linux)
Or are you saying that this doesn't work:
GENERATE(linux) -> SERVLET(linux) -> VIEW(windows)
?
ASKER
my development OS is in windows... the deployment (upload) OS is in linux.. so.. as for windows everything works fine...
So this works:
GENERATE(windows) -> SERVLET(windows) -> VIEW(windows)
So this works:
GENERATE(windows) -> SERVLET(windows) -> VIEW(windows)
And this:
GENERATE(linux) -> SERVLET(linux) -> VIEW(windows)
fails?
GENERATE(linux) -> SERVLET(linux) -> VIEW(windows)
fails?
try to save the file in unicode encoding format
ASKER
i tried using unicode encoding as well as the below way also,
rtfExporter.setParameter(J RExporterP arameter.O UTPUT_STRE AM, response.getOutputStream() );
it doesn't works....
do i need apply any french font while i create the doc/rtf ?
rtfExporter.setParameter(J
it doesn't works....
do i need apply any french font while i create the doc/rtf ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok...RTF formats works well..but designs are not applied properly... only TEXT's could be displayed...
so i have to go for .doc formate... how do i solve it in .doc format?
so i have to go for .doc formate... how do i solve it in .doc format?
ASKER
anymore comments?
ie: Is it a generation problem, or a transmission problem?