StrataFrame Forum

How Do I Translate a Filtered DevEx Grid to a BO?

http://forum.strataframe.net/Topic17763.aspx

By Bill Cunnien - 7/10/2008

The DevEx grid is really nice.  I have set one of my columns to present a checked list for filtering.  Slick.  Now, I want to take the users filtered records and bake them into a report.  I'd like to create a BO that has each of these filtered records.  Is there an easy way to do this?  Or do I need to "walk" the grid and, somehow, copy these records into a new BO, then use that BO to generate a report?

Thanks for your help!!
Bill

By Trent L. Taylor - 7/10/2008

To be honest, without setting this up I can't give you a straight answer.  I do not live in the DevExpress grid so I really don't know what they are doing behind the scenes here.  The bottom line, though, is that if you can apply the filter on the BO then it will translate into the report.  You would really want to create a custom BBS (using the new 1.6.6 template) as your data source then you could just pass that data source over to a report.  But without "getting my hands dirty" I am not going to be able to give you a 100% answer on this as I just do not have the DevExpress grid logic in my head since it is not something that I use myself.
By Kenneth Langley - 7/10/2008

The filter object has a property named "FilterString". This string can be applied as a filter on the Business object to give you the records you need for your report.

Good luck

By Bill Cunnien - 7/10/2008

Thanks!  I will try assigning the filter string (ActiveFilterString?) to the BO.  Great idea! 
By Paul Chase - 7/10/2008

Bill,

I am doing the same thing it is the cat'sass , just take the filter from the grid and apply it to the reports filter string property this will filter the report, something like below, also you can get snazzy and allow the user to save the filter and then create their own list of saved filters so they can simply choose from a list and apply whatever saved filter fits the bill or create a new one.  

Dim lcfilter As String = Me.GridView1.ActiveFilter.Expression

'Set filter

xtrareport.FilterString = lcfilter

By Bill Cunnien - 7/11/2008

Farm out, man!  That is great...I will definitely use that tip.  MANY thanks!!