Databand not showing based on a condition

Stimulsoft Reports.NET discussion
Post Reply
JeffZ
Posts: 2
Joined: Wed Dec 01, 2010 5:46 pm
Location: Scottsdale, AZ

Databand not showing based on a condition

Post by JeffZ »

Hi all. I hope someone might be able to give me some insight on how to do this. I would like to show a Text area with some text in it instead of the Databand ONLY when there are no rows present in the datasource for that databand. For some of my reports, I need to show a piece of text if no rows are present for the Databand to load. Any help would be appreciated. Thanks!
JorisWils
Posts: 86
Joined: Tue Jun 30, 2009 7:49 am
Location: belgium

Databand not showing based on a condition

Post by JorisWils »

It may bot be a pretty sollution, but I already do this:

I have 1 master-band having 2 child bands.
I have 1 variable, being a boolean. Let's call it: blnDataAvailable with a default value "false"

in the first child band I print data if there is any
in the after print event of this band I set the variable blnDataAvailable=true;
Right now we have data so the boolean is set to true and we will not print the text.
If we have no data the boolean would still be set to false


then in the second band I place a textbox with text.
In the filter of this band I set the filter to "expression" and filter "blnDataAvailable==false"

You could also disable the second band with a condition.
Using Stimulsoft since 2007
JeffZ
Posts: 2
Joined: Wed Dec 01, 2010 5:46 pm
Location: Scottsdale, AZ

Databand not showing based on a condition

Post by JeffZ »

Thanks JorisWils. That makes sense. It would be nice if the system had bands for conditional expressions. Maybe something for the next version?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Databand not showing based on a condition

Post by Alex K. »

Hello,

Unfortunately, we do not have plans to develop in this direction. On the current moment, the mechanism of condtitions is overloaded and it is very hard to add something.

Thank you.
JorisWils
Posts: 86
Joined: Tue Jun 30, 2009 7:49 am
Location: belgium

Databand not showing based on a condition

Post by JorisWils »

Aleksey

So would you suggest my sollution too? Or will this bite us in the ass sooner or later?
I actually use this in all our reports over here.
Using Stimulsoft since 2007
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Databand not showing based on a condition

Post by Alex K. »

Hello,

We did not mean your suggestion for solving the issue, but ability of adding "bands for conditional expressions" that was requested by JeffZ. The reasons are discribed in my previous post.

Thank you.
Post Reply