Problem with Stretch with overflow

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
1755
Joined: Aug 17 2009 - 6:22am
Last seen: 13 years 9 months ago

Hi Teodor,

I have a main report with "vertical" print order which has for sub report with "horizontal" print order. Each subreport I have some textfields and I selected "float" position, "Relative with tallest object" strech type and check strech with overflow. But it not working.

Can you please help me how to fix them?

Thanks

NhiTran - 2 years 5 months ago

10 Answers:

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

svenn's picture
12926
Joined: Mar 19 2007 - 5:57am
Last seen: 16 years 2 months ago

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
1755
Joined: Aug 17 2009 - 6:22am
Last seen: 13 years 9 months ago

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: 10 years 7 months ago

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
46734
Joined: Jun 30 2006 - 9:00am
Last seen: 3 days 6 hours ago

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
46734
Joined: Jun 30 2006 - 9:00am
Last seen: 3 days 6 hours ago

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: 10 years 7 months ago

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
1755
Joined: Aug 17 2009 - 6:22am
Last seen: 13 years 9 months ago

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: 13 years 8 months ago

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
1755
Joined: Aug 17 2009 - 6:22am
Last seen: 13 years 9 months ago

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
46
Joined: Apr 27 2009 - 7:04pm
Last seen: 14 years 1 month ago
Feedback
randomness