Page 1 of 1

HorizontalLine Conditional Formatting

Posted: Mon Oct 19, 2015 6:58 am
by simgschw
Hi,

I need to display a horizontal line on certain condition. I added a condition but after rendering my report did not changed!

I created an sample report. In this report there is Horizontal Line 'HLine'. The component's color is transparent. The component should change its color to black when the condition defined in 'Conditions' is met but it won't work. Color should be changed when displayed value of column 'KeimSpalte' from DataSource1 starts with 'A'. The DataSource1 is a csv datasource(you have to set csv-datasource location before rendering report).

Can you please help me?

Re: HorizontalLine Conditional Formatting

Posted: Mon Oct 19, 2015 10:00 pm
by Ivan
Hello,

Please add the following line of code to the BeforePrint event of the DataBand2 component:

Code: Select all

HLine.Color = (DataSource1.KeimSpalte.StartsWith("A")) ? Color.Black : Color.Transparent;
Thank you.

Re: HorizontalLine Conditional Formatting

Posted: Tue Oct 20, 2015 8:43 am
by simgschw
Thank you!

This solved my issue!

Re: HorizontalLine Conditional Formatting

Posted: Tue Oct 20, 2015 11:24 am
by Andrew
Great!

Thank you.