Page 1 of 2
Adding conditional spacing between data.
Posted: Fri Jan 16, 2015 7:03 pm
by Paulo Lemos
Hi, I'm trying to solve this very simple issue for several hours.
I need to skip a line, or add a space above registers that has the Data.Alive == true, when the Data2.Skip == true too.
Ex:
Id Name Type Alive
1 Raphael Master True
2 Leonardo Master True
3 Donatello Slave False
4 Michellangelo Slave False
5 Splinter Master False
6 Shredder Master True
And so on...
My report layout is very simple too: just a Group header band with one condition (grouping by Masters), and the data band showing the data.
I really tryed a lot of things before asking here... I know it seems very simple, but i couldn't solve it yet. What would be the best approach to do it?
Thank you.
EDIT: Solved it.
Re: Adding conditional spacing between data.
Posted: Fri Jan 16, 2015 7:17 pm
by Paulo Lemos
Can I set the Height, or some other property of the band with a expression?
Ex:
Set GroupHeaderBand: Masters Height to 1.6 when the register shown on it is Data.Alive == true.
Actually, setting Band and Label properties with expressions would solve 90% of all my problems with Stimulsoft. Is it possible?
Re: Adding conditional spacing between data.
Posted: Fri Jan 16, 2015 8:04 pm
by Paulo Lemos
Finally, after a day trying it, I could solve it myself. I added a second GroupHeaderBand above the another one, with the same conditions to group by Master, but with the condition to only enable it if the value of Data2.Skip == true AND Data.Alive == true.
But my other question remains, about setting properties with expressions.
Thank you.
Re: Adding conditional spacing between data.
Posted: Mon Jan 19, 2015 6:04 am
by Alex K.
Hello,
Please try to set the bands Height property in the BeforePrint events.
Thank you.
Re: Adding conditional spacing between data.
Posted: Mon Jan 19, 2015 10:21 am
by Paulo Lemos
Aleksey wrote:Hello,
Please try to set the bands Height property in the BeforePrint events.
Thank you.
My question is exactly that. How do I set properties with expressions. What do I need to write in the BeforePrint event to set the height or any other property of some component? Can you send me an example?
Thank you.
Re: Adding conditional spacing between data.
Posted: Tue Jan 20, 2015 12:25 pm
by HighAley
Hello.
You could use code like next:
Thank you.
Re: Adding conditional spacing between data.
Posted: Wed Jan 21, 2015 12:53 pm
by Paulo Lemos
Aleksey Andreyanov wrote:Hello.
You could use code like next:
Thank you.
I will test it. Thanks a lot!
Re: Adding conditional spacing between data.
Posted: Thu Jan 22, 2015 7:17 am
by Alex K.
Hello,
Let us know if you need any additional help.
Re: Adding conditional spacing between data.
Posted: Thu Jan 22, 2015 4:40 pm
by Paulo Lemos
Aleksey wrote:Hello,
Let us know if you need any additional help.
Hi Aleksey!
I tried to set the "Before Print" event of a GroupHeaderBand with the follow expression:
data.SpacesBetweenAlive == true ? Text1.Height = 3 : Text1.Height = 1
And many other variations without success.
I hope you can understand what I'm trying to do here: to set Height and any other property by conditional expressions.
If you could please send me some example doing it or teach me how to write it properly, would be great. If this can't be done by expressions, but you can set any property values on the "condition" property somehow, would work for me too.
Thank you.
Re: Adding conditional spacing between data.
Posted: Fri Jan 23, 2015 12:12 pm
by HighAley
Hello.
We are sending you a sample report template.
Thank you.