HorizontalLine Conditional Formatting

Stimulsoft Reports.NET discussion
Post Reply
simgschw
Posts: 73
Joined: Mon Jan 07, 2013 1:34 pm

HorizontalLine Conditional Formatting

Post 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?
Attachments
csv_datasource.csv
CSV datasource
(204 Bytes) Downloaded 174 times
HighlightCondition_Modified.mrt
Report
(21.11 KiB) Downloaded 317 times
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: HorizontalLine Conditional Formatting

Post 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.
simgschw
Posts: 73
Joined: Mon Jan 07, 2013 1:34 pm

Re: HorizontalLine Conditional Formatting

Post by simgschw »

Thank you!

This solved my issue!
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: HorizontalLine Conditional Formatting

Post by Andrew »

Great!

Thank you.
Post Reply