Windows Forms End-User Report Designer–Custom Field Icons (coming in v2010 vol 2)

22 November 2010

Coming in v2010 vol 2 we have added the ability to provide custom images for field list elements in the end-user report designer. Take a look:

CustomFieldList

The best way to do this is to add a new component and drag on an image collection (you could also create an image collection from scratch) and then inherit from the IFieldListService interface that lives in the DevExpress.XtraReports.UserDesigner namespace. If you go the component route, you select images just as you would expect:

ImageCollection

Once you implement the interface, there are only 4 methods that need to be overridden. The one of most interest is the GetColumnImageIndex function that returns the index of the images. Take a look:

  1: public int GetColumnImageIndex(PropertyDescriptor property, string dataMember, bool isList)
  2: {
  3:     if (dataMember == "Categories")
  4:         return 1;
  5:     if (dataMember == "Customers")
  6:         return 2;
  7:     if (dataMember == "Employees")
  8:         return 3;
  9:     if (dataMember == "Orders")
 10:         return 4;
 11: 
 12:     return 0;
 13: }

As always, if there are any questions and/or comments, do feel free to get a hold of me!

Seth Juarez
Email: sethj@devexpress.com
Twitter: @SethJuarez

2 comment(s)
Michael Proctor [DX-Squad]

I have only just started implementing End User Designer support for my application, and all I can say is it is freaking brilliant.

Adding things like this only make it better. Well Done.

22 November, 2010
Alex Boston

If this will integrate with XAF if we define an image on filed level.

this this will be really a good thing

23 November, 2010

Please login or register to post comments.