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

How to get the stretched height of JasperReport's 5.9.0 TextField with help of JasperReports API?


javascriptwww

Recommended Posts

I encountered a problem, how to calculate the required height of the text in the TextField with "Stretch with Overflow" attribute in Java.

I have been trying for a whole day, but I still don't have a better idea. I have two ideas.

  1. The first is to put the text in the TextFiled and get the height, but the obtained height is always the original height of the TextField.
  2. The second is to put the TextField into JRDesignBand and get the next Band Y-axis height, but I don't know how to achieve it.

I need to calculate the height accurately to achieve a strict report format, so I really need to use this method. Thank you very much for your help.

The following snippet code I tried.

    JRDesignTextField textField = new JRDesignTextField();    textField.setWidth(183);    textField.setHeight(38);    textField.setStyle(normalStyle);    textField.setStretchWithOverflow(true);    textField.setExpression(expression);    System.err.println("TextField Height: " + textField.getHeight());[/code]

  

 

 

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