Color DataBand

Stimulsoft Reports.NET discussion
Post Reply
Leandro Borges
Posts: 219
Joined: Tue Oct 27, 2015 4:19 pm

Color DataBand

Post by Leandro Borges »

Hello.

In my database I have the whole number of a color. Is it possible to convert this number into a color and paint the band?

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Color DataBand

Post by HighAley »

Hello, Leandro.

You could set the color using the Before Print event of the Band.

Code: Select all

((sender as StiDataBand).Brush as StiSolidBrush).Color = Color.Blue;
Thank you.
Leandro Borges
Posts: 219
Joined: Tue Oct 27, 2015 4:19 pm

Re: Color DataBand

Post by Leandro Borges »

Hello.

It worked. But it has another detail, if the color is dark, the text component the band needs to change its color to a light color and vice versa. Is there a function that identifies whether the color is light or dark?

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Color DataBand

Post by Alex K. »

Hello,

Unfortunately, the are not functions for this task.
You need check it in you code.

Thank you.
Leandro Borges
Posts: 219
Joined: Tue Oct 27, 2015 4:19 pm

Re: Color DataBand

Post by Leandro Borges »

Hello,

Ok.

Thank you.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Color DataBand

Post by Andrew »

Leandro,

We are always glad to help you.
Post Reply