Move a field when another field is null or hide
Posted on March 31, 2009 at 1:19am
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
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago
Posted on March 31, 2009 at 4:33am
Set isRemoveLineWhenBlank="true" for the text that can be skipped.
HTH,
Lucian
Joined: Jul 17 2006 - 1:10am
Last seen: 23 hours 18 min ago
Posted on March 31, 2009 at 5:17am
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!
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago
Posted on March 31, 2009 at 7:46am
Try setting positionType="FixRelativeToBottom" for the footer elements.
Joined: Jul 17 2006 - 1:10am
Last seen: 23 hours 18 min ago
Posted on April 1, 2009 at 12:55am
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
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago
Posted on April 1, 2009 at 7:30am
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
Joined: Jul 17 2006 - 1:10am
Last seen: 23 hours 18 min ago
Posted on April 1, 2009 at 7:51am
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
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago
Posted on April 3, 2009 at 12:29am
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
Joined: Jul 17 2006 - 1:10am
Last seen: 23 hours 18 min ago
Posted on April 3, 2009 at 12:45am
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
Joined: Feb 12 2007 - 5:03pm
Last seen: 16 years 7 months ago
Posted on January 23, 2019 at 1:43pm
Hi, where i can consult that sample report i have the same question but i implement the solutions and it does not work
Joined: Jan 23 2019 - 1:37pm
Last seen: 4 years 8 months ago
Posted on January 1, 2020 at 8:40pm
same Question I also have.I tried but it is not working .Please help me some one.thanks&Regards
Joined: Jan 1 2020 - 8:16pm
Last seen: 3 years 9 months ago
Posted on January 16, 2021 at 5:30am
Could some give an example to achieve this? Where can I access to modified report mentioned here?
Thanks in advance.
Joined: Sep 7 2020 - 5:21am
Last seen: 2 years 7 months ago
nice question, straight to the point.