Jump to content
We've recently updated our Privacy Statement, available here ×

"Pattern" set in iReport 4.1.1 not honored when JRXML run in 4.1.0


dogfuel

Recommended Posts

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

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

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

  • 2 months later...
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

  • 4 months later...

 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

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