Move a field when another field is null or hide
Posted on March 31, 2009 at 1:19am
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.
EFGEFG <=this has a print when expression
=> output is now
=> I want:
I hope someone can help me?
Thanks in advance
Posted on March 31, 2009 at 4:33am
Set isRemoveLineWhenBlank="true" for the text that can be skipped.
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!
Posted on March 31, 2009 at 7:46am
Try setting positionType="FixRelativeToBottom" for the footer elements.
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,
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.
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,
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.
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 :)
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
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
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.