black_lotus Posted June 28, 2010 Share Posted June 28, 2010 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 More sharing options...
black_lotus Posted June 30, 2010 Author Share Posted June 30, 2010 So I tried appending some extra characters to the end of the text inside the JRDesignTextField (one, then two, etc.)... no change. Then I tried adding a blank extra character to the beginning and end, and that seems to work. Go figure. Link to comment Share on other sites More sharing options...
lucianc Posted July 2, 2010 Share Posted July 2, 2010 Which output format does show the truncated text?Regards,Lucian Link to comment Share on other sites More sharing options...
black_lotus Posted July 5, 2010 Author Share Posted July 5, 2010 PDF Link to comment Share on other sites More sharing options...
lucianc Posted July 5, 2010 Share Posted July 5, 2010 See http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html#FAQ25HTH,Lucian Link to comment Share on other sites More sharing options...
LinuxLars Posted May 16, 2013 Share Posted May 16, 2013 lucianc - the link no longer works and I'm having this issue. Do you remember the solution? 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