Adding conditional spacing between data.

Stimulsoft Reports.NET discussion
Paulo Lemos
Posts: 19
Joined: Tue Jan 06, 2015 7:39 pm

Adding conditional spacing between data.

Post 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.
Last edited by Paulo Lemos on Fri Jan 16, 2015 8:06 pm, edited 1 time in total.
Paulo Lemos
Posts: 19
Joined: Tue Jan 06, 2015 7:39 pm

Re: Adding conditional spacing between data.

Post 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?
Paulo Lemos
Posts: 19
Joined: Tue Jan 06, 2015 7:39 pm

Re: Adding conditional spacing between data.

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Adding conditional spacing between data.

Post by Alex K. »

Hello,

Please try to set the bands Height property in the BeforePrint events.

Thank you.
Paulo Lemos
Posts: 19
Joined: Tue Jan 06, 2015 7:39 pm

Re: Adding conditional spacing between data.

Post 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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Adding conditional spacing between data.

Post by HighAley »

Hello.

You could use code like next:

Code: Select all

Text1.Height = 3;
Thank you.
Paulo Lemos
Posts: 19
Joined: Tue Jan 06, 2015 7:39 pm

Re: Adding conditional spacing between data.

Post by Paulo Lemos »

Aleksey Andreyanov wrote:Hello.

You could use code like next:

Code: Select all

Text1.Height = 3;
Thank you.
I will test it. Thanks a lot!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Adding conditional spacing between data.

Post by Alex K. »

Hello,

Let us know if you need any additional help.
Paulo Lemos
Posts: 19
Joined: Tue Jan 06, 2015 7:39 pm

Re: Adding conditional spacing between data.

Post 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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Adding conditional spacing between data.

Post by HighAley »

Hello.

We are sending you a sample report template.
Report.mrt
(18.45 KiB) Downloaded 346 times
Thank you.
Post Reply