dogfuel Posted October 17, 2011 Share Posted October 17, 2011 Regardless of the pattern set in iReport, reports, when run in jasperserver, show the number formatted as it is returned by the query. Any thoughts or help on this? JRXML includes the below and seems correct. Thanks!Code:<textField pattern="#,##0;(#,##0)"> Link to comment Share on other sites More sharing options...
tbr0 Posted October 20, 2011 Share Posted October 20, 2011 I am having the exact same problem. If one defines a field pattern in iReport or just plain jrxml, this field pattern does not apply when running this report on JasperServer. I just upgraded to 4.2.1 from 4.1, and found that this problem happens on both versions. This hasn't always happened though. I distinctly remember the field pattern correctly applying in JasperServer just a few months ago.I know specifically in my scenario it is happening with a date field and a percentage field. The date field is display locally in iReport as 10-18-11, but on JasperServer it is displayed as Tue Oct 18. The percentage is displayed locally in iReport as 47%, but when the same report is ran on my JasperServer, it is .47839394 and so on.The only clue I have is abstract, as I don't have time to pull the links. But there are articles in the iReport forums explaining solutions for how to define field patterns for excel. It talks about a document in WEB-INF that is responsible for applying the field pattern definitions. I'm sure someone more experienced with those xml files might see a discrepancy, and ultimately a reason for this occurrence.Post Edited by tbr0 at 10/20/2011 21:52 Link to comment Share on other sites More sharing options...
dogfuel Posted October 28, 2011 Author Share Posted October 28, 2011 Code:Is no one else having this problem? It makes jasperserver unusable for our intended application. (had to reply in the code box due to forum issues that have been there for a few days... not a good indicator!) Link to comment Share on other sites More sharing options...
kevincal Posted January 12, 2012 Share Posted January 12, 2012 Likewise I am experiencing the same issue. JasperServer is ignoring the pattern attribute and displaying the data raw. Any updates? Has there been a ticket submitted?Code:<textField pattern="#,##0"> <reportElement style="Regular" x="92" y="79" width="104" height="20"/> <textElement> <font size="14"/> </textElement> <textFieldExpression><![CDATA[$F{y_unique_visitors_total}]]></textFieldExpression> </textField> Link to comment Share on other sites More sharing options...
kevincal Posted January 12, 2012 Share Posted January 12, 2012 I've submitted a bug:http://jasperforge.org/projects/jasperserver/tracker/view.php?id=5599 Link to comment Share on other sites More sharing options...
davelevy Posted May 21, 2012 Share Posted May 21, 2012 Have you made sure that the data types are the same? (Field is Java.lang.integer and Text Box is Java.lang.String)I'm running in 3.7 and have found that when the data types do not match, the pattern is ignored and formatting runs amok. 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