Jump to content
Changes to the Jaspersoft community edition download ×

inconsistent output between containers

2005 IR Help

Recommended Posts

By: Phillip Rhodes - sprhodes

inconsistent output between containers

2004-07-20 15:19

Hi, I'm using Jasper Reports to generate reports from a web application. The reports work as expected when deployed onto a JBoss server on Linux, using Sun JVM. They also work fine on Websphere Application Server, running on Windows, using IBM JVM.


But, and this is the weird part... if I deploy to Tomcat on Windows (which is our current production setup), my generated report is different. Two of the fields simply do not appear at all. Looking at the XML output generated using JRXmlExporter, it appears that the field in question has simply been skipped completely by the FillManager.


Any idea what could be causing this, or what I might should do to work around it? I find this to be very weird in that it works fine on two combinations of OS / JVM / Container, but fails on a third. Any and all help is greatly appreciated.





By: Phillip Rhodes - sprhodes

RE: inconsistent output between containers

2004-07-20 15:26

Oh, and I guess I should add that I'm using JasperReports 0.5.2 at the moment. I'm downloading 0.5.3 right now to see if that improves the situation.





By: jadawinrules - jadawinrules

RE: inconsistent output between containers

2004-07-20 22:52

There's no such problem with the code. You just discovered how evil it can be just to switch JVM.





By: Phillip Rhodes - sprhodes

RE: inconsistent output between containers

2004-07-20 17:05

Ok, further info: I took the machine that was running Tomcat on Windows, and switched from the Sun JVM to the IBM JVM, and it works as expected now.


It appears there is something going on in the guts of JasperReports that is not 100% portable across JVM's and OS's (Sun JVM on Linux works as well).


I don't know if this indicates a bug in JasperReports or a bug in one of the JVM vendor's implementation, but something non-portable is going on. If I get some spare time, I'll take a look into the JR source and see if I can spot anything that might be causing this.


In the meantime, it looks like I can just use the IBM JVM to get around the problem. Or maybe JR 0.5.3 will help.





By: Chuck Deal - cdeal

RE: inconsistent output between containers

2004-07-21 05:06

In the past, I have read posts concerning a similar issue. THe problem was with the way Jasper determines how much text can fit in the field. It uses the font metrics object. On the different OSes, sometimes you got different results. In those cases, I believe you had to increase the height of the text field to get the text to display properly on both Linux and Windows.


I don't remember a correlation between JVM in those cases, however.





By: Phillip Rhodes - sprhodes

RE: inconsistent output between containers

2004-07-21 13:51

Chuck Deal:


Yes, that seems to be correct. Something I read last night prompted me to trying increasing the height of the "missing" text fields, and sure enough it worked.


Why I got different results when toggling between JVM's, while staying on the same OS / hardware platform is still something of a mystery, but see below:




It may not be a "problem with the code" per se, but it is an issue. If, as Chuck says, it has to do with how the different platforms handle font metrics, then it would be nice if jasperreports could detect what platform it was running on, and make suitable accomodations.


<idle speculation>

Another possibility would be floating point math. If japserreports uses floating point math internally as part of those calculations to determine how much text can fit in a field, there is the possibility of getting different results on different platforms. There is a Java language keyword, strictfp, which forces code to use a standard approach to floating point. IF jasperreports is using fp math internally, and if it doesn't currently use strictfp, that might be something the authors should consider. Yes, Java is supposedly 100% portable, but in truth subtle little issues between platforms do crop up from time to time.

</idle speculation>





By: Prem - premb007

RE: inconsistent output between containers

2004-07-26 04:27

I am facing a similar problem though not related to different JVMs. I use the same TTF fonts for printing a report using Java print API & export to a pdf file. (The pdf font used is the same)


Still I get a difference in the output.


I am at my wits end to solve this problem.


Any pointers will be of help.





By: Mihir Parekh - mihirparekh

RE: inconsistent output between containers

2004-07-30 04:29

We have been facing the problem with TTF fonts on windows and linux. Even on windows there is a difference in output if we use Times Roman with and without TTF. It seems that field width is not calculated correctly.


Any suggestions or pointers would really help.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...