Conditional Formatting of Background Colour

Stimulsoft Reports.NET discussion
Post Reply
Ink
Posts: 50
Joined: Sat Jul 02, 2011 2:26 am
Location: UK

Conditional Formatting of Background Colour

Post by Ink »

Hi,

I am building a report based on data in an xml file. the file also contains information on colour for certain value in the format Color [A=255, R=239, G=43, B=45].
I can read the file into stimulsoft no problem, including the color value (it just appears as a string field). What I need to do is change the background colour of a text box based on the color value from the xml at runtime.
I can if neccessary have the color value written to the xml file as an integer value if that is more appropriate.

I would like to do all of the formatting inside the mrt file, so at runtime the application just opens the file & it formats colours as required.

Thanks

Jon.
Ink
Posts: 50
Joined: Sat Jul 02, 2011 2:26 am
Location: UK

Conditional Formatting of Background Colour

Post by Ink »

Sorted it out from another answer on this forum

solution is

Dim backColor As String

backColor = {Field.FieldValue}
Text1.Brush = New StiSolidBrush(ColorTranslator.FromOle(backColor))

Thanks,

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

Conditional Formatting of Background Colour

Post by HighAley »

Hello, Jon.
Ink wrote:Sorted it out from another answer on this forum

solution is

Dim backColor As String

backColor = {Field.FieldValue}
Text1.Brush = New StiSolidBrush(ColorTranslator.FromOle(backColor))
Yes, this is a solution for your problem.
If you need a more specific response, please send us your report template.

Thank you.
Post Reply