Move a field when another field is null or hide

Good morning,

 

I have a question.
I have some textfields that have a print when expression.
And these textfields are pritty large, so when the print when returns false, I dont want a blanc block.
I want the other field(s) to move UP.


Example

 

ABCABC
EFGEFG <=this has a print when expression
HIJHIJHIJ

 

=> output is now

ABCABC

HIJHIJHIJ

 

=> I want:

ABCABC
HIJHIJHIJ

I hope someone can help me?
Thanks in advance

giroe's picture
1009
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago

nice question, straight to the point.

emmanuelt - 6 years 1 month ago

11 Answers:

Set isRemoveLineWhenBlank="true" for the text that can be skipped.

HTH,

Lucian

lucianc's picture
87397
Joined: Jul 17 2006 - 1:10am
Last seen: 23 hours 18 min ago
Should have tested it myself. I saw that option. But I didnt think it would work with the 'print when' expression. This was exactly what I needed. But is there a way to say that 'some' elements should NOT move up :)? I dont want the things at the bottom to shift up. It's some sort of footer, but it is not located in the footer-band. Thanks in advance!
giroe's picture
1009
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago

Try setting positionType="FixRelativeToBottom" for the footer elements.

lucianc's picture
87397
Joined: Jul 17 2006 - 1:10am
Last seen: 23 hours 18 min ago
I already tried that. But that does not do the trick. I do believe it should do the trick :) When you 'click' on the position type it sais: How to anchor elements. And thats just what I want, to anchor it to the bottom. This is a small bug? Or are there any other solutions? I think I'll create a footer for the things I want to be at the bottom :) Btw, I dont know if its a bug, or it is something wrong with me. But when I say to windows: open all jrxml files with iReport. In 3.0.0 it did not open iReport, in 3.1.4 it does open iReport, but it doesn't open the report. (just opens iReport) Btw, is it better to use 3.1.4 or is 3.0.0 still fine? Because I do like 3.0.0 better to work with. A lot has changed in 3.1.4 :) Thanks for you replies, Nick
giroe's picture
1009
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago

Do you have a sample report to illustrate the FixRelativeToBottom problem?

Regarding the iReport issues, I think you would get more educated answers on the iReport forum.  If you like iReport 3.0.0 better than 3.1.4, go ahead and use it for now.  The problem is that iReport 3.0.0 will stay as it is now and you will not have support for new JasperReports features.  At the time you will need this support, hopefully the new iReport will have caught up in terms of usability.

Regards,

Lucian

lucianc's picture
87397
Joined: Jul 17 2006 - 1:10am
Last seen: 23 hours 18 min ago

Ok, I made a very simple example

Field 2 will hide,

Field 3 should move up (it does)

Field 4 is anchored to the bottom, so it should not move up, but it does..


Thanks for your help,

 

 

Nick

 

 

giroe's picture
1009
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago

Indeed, I should have realized that removeLineWhenBlank affects FixRelativeToBottom elements as well.

To achieve what you want, you can nest the "mobile" elements into a frame so that the changes caused by the element which is removed stay inside the frame and do not touch elements outside.  I'm attaching your report modified to use a frame.

Regards,

Lucian

lucianc's picture
87397
Joined: Jul 17 2006 - 1:10am
Last seen: 23 hours 18 min ago
That's pritty nice such a frame! It also has a print when expression. Didn't every see that element :) Thanks, you solved (all) my problems :) Greetings, Nick
giroe's picture
1009
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago

Hi, where i can consult that sample report i have the same question but i implement the solutions and it does not work

carlos_nj23's picture
Joined: Jan 23 2019 - 1:37pm
Last seen: 4 years 8 months ago

same Question I also have.I tried but it is not working .Please help me some one.thanks&Regards

sreekanthvnu4's picture
Joined: Jan 1 2020 - 8:16pm
Last seen: 3 years 9 months ago

This is an old question and your question is hidden in this old answer. Ask a new question.

djohnson53 - 3 years 9 months ago

Could some give an example to achieve this? Where can I access to modified report mentioned here?
Thanks in advance.

mmaciel's picture
78
Joined: Sep 7 2020 - 5:21am
Last seen: 2 years 7 months ago
Feedback
randomness