Sorting by condition or BeforePrint event
Posted: Fri Feb 13, 2015 6:36 pm
Hi there,
Is there a way to set the sorting property of a data band by a condition based on another property informed in a second Dictionary (query)?
Ex:
A report listing clients.Id, clients.Name and clients.PhoneNumber from the "clients" Dictionary, obviously. But I have a second Dictionary named "filter", with a single property of type int, called sortBy.
So, if filter.sortBy == 1, data band will sort by Id, sortBy == 2 data band will sort by name, and if sortBy == 3 it would sort by PhoneNumber.
I had solved this by another way, doing a switch/case orderBy in the query, on beforePrintReport event, and disabling any sorting of GroupHeaderBands, but I really would like to know if its possible of doing inside stimulsoft's, like using BeforePrint event on the data band or something like that.
Thanks in advance!
Is there a way to set the sorting property of a data band by a condition based on another property informed in a second Dictionary (query)?
Ex:
A report listing clients.Id, clients.Name and clients.PhoneNumber from the "clients" Dictionary, obviously. But I have a second Dictionary named "filter", with a single property of type int, called sortBy.
So, if filter.sortBy == 1, data band will sort by Id, sortBy == 2 data band will sort by name, and if sortBy == 3 it would sort by PhoneNumber.
I had solved this by another way, doing a switch/case orderBy in the query, on beforePrintReport event, and disabling any sorting of GroupHeaderBands, but I really would like to know if its possible of doing inside stimulsoft's, like using BeforePrint event on the data band or something like that.
Thanks in advance!