Jump to content
Changes to the Jaspersoft community edition download ×

issues stretching JRDesignTextField


black_lotus

Recommended Posts

I have a few JRDesignTextField's that are added to my report programmatically. Some of the text in the fields is too long and requires stretching vertically over multiple lines. The fields stretch, however some don't seem to stretch enough and some of the words gets cut off. The fields are wide enough to hold at least one word per line. Below is the code I use for the field. Is there something I need to add/change in order for the stretch to work properly? Thanks.

 

Code:
JRDesignBand columnHeaderBand = new JRDesignBand();columnHeaderBand.setHeight(22);columnHeaderBand.setSplitAllowed(false);        textField = new JRDesignTextField();textField.setWidth(75);textField.setX(((colWidth - textField.getWidth()) / 2) + colWidth * (i + 3) - 30);textField.setY(6);textField.setPositionType(JRElement.POSITION_TYPE_FLOAT);textField.setStyle(headerStyle);textField.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_RIGHT);textField.setVerticalAlignment(JRAlignment.VERTICAL_ALIGN_MIDDLE);            textField.setEvaluationTime(JRDesignExpression.EVALUATION_TIME_NOW);textField.setStretchWithOverflow(true);expression = new JRDesignExpression();expression.setValueClass(java.lang.String.class);expression.setText(""" + myObject.get(i).getName() + """);textField.setExpression(expression);columnHeaderBand.addElement(textField);

Post Edited by some_one at 06/28/2010 16:16
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 years later...

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