Jump to content
Changes to the Jaspersoft community edition download ×

How to put decimal number in index (right/up)


GoRun

Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

If the position of the decimal point is fixed, you can just create another text field with smaller fonts for the index. JasperReports doesn't support changing font attributes within a text field.

If the position of the decimal point is not fixed, the best I can think of is to create a scriiplet that returns the "text" as an image and to use an image component.

Link to comment
Share on other sites

  • 3 weeks later...

You can achieve what you want with styled text, a JasperReports proprietary markup language. With this markup you can modify some of the style attributes like: font name/size/weight, background color, etc.

More info about the available markup can be found here: http://jasperreports.sourceforge.net/sample.reference/styledtext/

For your specific case you could have a textfield with the markup specified like this:

<textField>

 <reportElement x="320" y="119" width="100" height="30"/>

 <textElement markup="styled"/>

 <textFieldExpression><![CDATA["123.<sup>23</sup>"]]></textFieldExpression>

</textField>

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