Problem with Stretch with overflow

1

Hi everyone!

 

I have a text filed that has the Stretch with overflow set to true and it does start a new line. However, it does not move the next row down to compensate for it. By setting that text field to float and setting the field below it to float, that helps, but the text label does not follow suite.

 

Have a look at my screen shot to see what I mean. Is there a way to have the whole row move then when a field in the previous row stretched over two line?

 

http://img62.imageshack.us/img62/4765/wrapping.jpg

 

Thanks!

fatbob's picture
31
Joined: Aug 17 2009 - 6:22am
Last seen: 5 years 4 weeks ago

10 Answers:

0

Try putting all the items below the streached items in a frame and set the frame element to float.

svenn's picture
1107
Joined: Mar 19 2007 - 5:57am
Last seen: 7 years 6 months ago
0

Can it be that I don't have a frame element?

 

I'm running a very, very old version of JasperReports (v.0.6.6).

fatbob's picture
31
Joined: Aug 17 2009 - 6:22am
Last seen: 5 years 4 weeks ago
0

I am facing simular problems with "Stretch Type" option.

I have a report with three text fields in the detail band, two of them in a line above the third one. The second and the third fields have the option "Stretch With Overflow" selected. The first has the option "Stretch Type" seted to "Relative to Tallest Object" and all of them are the "Position Type" seted to "Fix Relative to Top".

With these options I have the same issue reported by fatbob (figure2.png).

If I change the option "Stretch Type" to "No stretch" in the first field and change the option "Position Type" to "Float" in the third field, the first field is not splitted according to the second one(figure1.png).

Now, if I return  the option "Stretch Type" to "Relative to Tallest Object" in the first field, the field in the second line, desappears (figure3.png). I am sending attached the .jrxml file in order to help the understanding of this issue.  

Thanks!

 

[edit] Now with the right jrxml file. Sorry!



Post Edited by claitongrings at 09/29/2009 14:43
claitongrings's picture
Joined: Aug 23 2007 - 10:00am
Last seen: 1 year 10 months ago
0

Steve,

 

Since you don't have frames in that old version, you could use a white line (invisible) to put in between the first row and the second row. Use positionType="Float" for the line and the elements below it.

When the text field will stretch, it will push the line which in turn will push the text fields downwards.

 

I hope this helps. Teodor

 

teodord's picture
2855
Joined: Jun 30 2006 - 9:00am
Last seen: 1 week 3 days ago
0

Claiton,

 

Your JRXML sample has only one text field. But that's beside the point.

 

Put the A and B text fields inside a frame, because they need to have the same height when B stretches. Use stretchType="RelativeToTallestObject" (it will be tallest object within the frame, no longer the band).

The use positionType="Float" for text field D.

 

I hope this helps.

Teodor

 

teodord's picture
2855
Joined: Jun 30 2006 - 9:00am
Last seen: 1 week 3 days ago
0

Hi Teodor,

 

I tested your suggestion and it worked fine!

 

Thanks a lot for your help.

 

Claiton

 

P.s.: I changed the file to the correct one in my previous post.

claitongrings's picture
Joined: Aug 23 2007 - 10:00am
Last seen: 1 year 10 months ago
0

teodord Wrote:

Steve,

 

Since you don't have frames in that old version, you could use a white line (invisible) to put in between the first row and the second row. Use positionType="Float" for the line and the elements below it.

When the text field will stretch, it will push the line which in turn will push the text fields downwards.

 

I hope this helps. Teodor

 

That's what I ended up doing. Works just fine.

 

Thanks!

fatbob's picture
31
Joined: Aug 17 2009 - 6:22am
Last seen: 5 years 4 weeks ago
0

Hi,

I am too facing a problem in stretching the textField. I have attached the two jrxml files. I am too using very old version of jasper so I too do not have the frames. In the CommentsNotes_Opp.jrxml  see the <textField> for commentsNotes at line# 99. I have added isStretchWithOverflow="true". Also search for CommentsNotes_Opp.jasper added as a subreport.

When I add a large text only the first two notes are displayed and no other note is displayed. I am getting the feeling that after it reaches the maximum length of band it stop to display any more text.

Can you plz help me out in how to stretch the height of the band?

 

Thanks, Muhammad Yousaf

 

m_yousaf61's picture
Joined: Sep 30 2009 - 11:44am
Last seen: 4 years 11 months ago
0

fatbob Wrote:

teodord Wrote:

Steve,

 

Since you don't have frames in that old version, you could use a white line (invisible) to put in between the first row and the second row. Use positionType="Float" for the line and the elements below it.

When the text field will stretch, it will push the line which in turn will push the text fields downwards.

 

I hope this helps. Teodor

 

That's what I ended up doing. Works just fine.

 

Thanks!

I think I may have spoken too soon.

 

Using the white line worked for some of my reports, but for other reports it's not working. It seems to stretch properly for the first row, but then the subsequent rows are missing fields. Have a look at my screen shot and you'll see what I mean. I made the white line visible to show where I've placed it. Can someone tell me why the "Clinical Notes:" is pushed down properly on the first row, but then disappears from all other rows? I even tried moving the fields from the detail band to footer of a group, still didn't work.

fatbob's picture
31
Joined: Aug 17 2009 - 6:22am
Last seen: 5 years 4 weeks ago
0

Im Also experiencing the same problem, but the difference in my case is the format.

In our reports, we give our user's a choice of either pdf or txt. The pdf reports are working fine however, the reports generated for txt format contains truncated lines. Im using the same template for both PDF and TXT.

 

Inputs are very much appreciated.

Thanks

geneqew's picture
Joined: Apr 27 2009 - 7:04pm
Last seen: 5 years 4 months ago
Feedback