Blogs

News

Favorite Posts

ctodx

Discussions, news and rants from the CTO of Developer Express, Julian M Bucknall

DXperience v2008 vol 3: Conditional formatting in reports (WinForms and ASP.NET)

     

An oft-requested feature in XtraReports is the ability to print certain report controls in the report differently based on some formatting rule. The rule would (presumably) be based on the values in the record bound to that control.

As usual, a picture is worth a thousand words. In this report the rows that have an extended price greater than $1000 are shown with a light green background.

image

In essence, the way this works is that the report controls you drop on the report designer surface have a property called FormattingRules, a collection of formatting rule objects. A formatting rule has a condition -- that is, an expression using the fields that evaluates to true or false -- and a set of display formatting properties, such as font color, attributes, background color and so on. At report generation time, these rules are evaluated and if satisfied the data is printed using the display formatting options. Otherwise, the default printing options are used.

Published Oct 28 2008, 10:45 AM by Julian Bucknall (DevExpress)
Filed under: ,
Technorati tags: XtraReports, v2008.3
Bookmark and Share

Comments

 

Nate Laff said:

Looks great. XtraReporting for 8.3 is looking good!

October 28, 2008 1:52 PM
 

Tarik Souirji said:

Thank you DevExpress !

October 28, 2008 3:46 PM
 

Robert Thomas said:

It would be nice if our formatting rules in XAF were applied in the XAFReport module.  Has that been considered yet?  Thanks.

October 28, 2008 3:48 PM
 

Linton said:

Nice feature, thanks!

October 28, 2008 4:29 PM
 

Mike_Grace said:

Is there a formatting rule which wouuld allow visible true or false.

I have reports where, based on rules, reports bands are either shown or hidden. I would be much easier to put this in the design view rather than the code behind.

October 29, 2008 6:19 AM
 

Alan (DevExpress) said:

Mike,

Yes, in v2008 vol 3 it will be possible not only to customize the appearance of a control or a band, but also to set the Visible property to True or False based upon a certain condition. I hope you'll like this feature! ;-)

October 29, 2008 8:41 AM
 

Shum Hussain said:

Alan!

thanks!! This is what i was looking for!!!!

December 4, 2008 9:14 AM

About Julian Bucknall (DevExpress)

Julian is the Chief Technology Officer at Developer Express. You can reach him directly at julianb@devexpress.com. You can also follow him on Twitter with the ID JMBucknall.
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.