How to hide Databand when it is empty?

Stimulsoft Reports.NET discussion
Post Reply
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

How to hide Databand when it is empty?

Post by jjc »

Hi All,
from 4 days i am trying to work out a task but i can't so i am here to share my problem .
In my report i have a Databand and retrieve data from Hotel,the design of this Databand is a bit complicated because i have 6 Panels (with 6 Databands ) into this Databand .Each Hotel has 3 Periods ("Low","High","Peak") with the Room's Price that list the price of the rooms in different period (the Room's Price are different choosing the period,i.e. in the "Low" period the price is cheaper than "Peak" period ),but not all Hotel got 3 Periods ,infact there are Hotels got only 1 period so here there is the problem when i choose some Hotel with just 1 period("High") i wish hide the databand that retrieve the data of "Low" and "Peak" period but i can't perform this task ; in this case i wish hide in the Report the Databand that show the "Low" period using this code in the Events Before Print :

Code: Select all

if( DataHotelPeriod_TBL.Count == 0)
{DataHotelPeriod_TBL.Enabled= false;
 Panel1.Enabled = false;
 Panel1.Printable = false;
DataBand10.Enabled= false;
 Panel10.Enabled = false;
//Panel6.Border.Side = StiBorderSides.None;
}
else
{DataHotelPeriod_TBL.Enabled = true;
//Panel6.Border.Side = StiBorderSides.All;
 Panel1.Enabled = true;
 Panel1.Printable = true;
DataBand10.Enabled= true;
 Panel10.Enabled = true;

}
..but when i run the report the Databand that retrieve the data of "Low" period did not disappear,so the report is wrong especially when a Hotel gets just 2 periods the Databand did not show the data in good way, instead when the Hotel gets 3 period i see it is right.

I hope you can understand my problem ,however i will send you the Project file with the database so you can understand better my problem.

Thanks so much for your attention.

Have a good day.

Cheers
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

How to hide Databand when it is empty?

Post by Ivan »

Hello,

Please check the "Hotel_StrangeBehaviour modified.mrt" in attachment.

Thank you.
Attachments
466.Hotel_StrangeBehaviour modified.zip
(35.08 KiB) Downloaded 432 times
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

How to hide Databand when it is empty?

Post by jjc »

Hi Ivan,
that's work great indeed,i did not believe i could work out this task as the design of the report was a bit complicated (and with my poor knowledge about report) ,really i got wonder what i can do with the Stimulsoft Report.

Thanks so much for your support and time dedicate to me.:biggrin:

Have a beautiful day.

Cheers :byebye:
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

How to hide Databand when it is empty?

Post by Andrew »

Hello,

Thank you very much for your good words.
Have a nice day too!! :biggrin:
Post Reply