Dynamically altering Group sorting

Hena

New member
Joined
Apr 12, 2006
Messages
1
Programming Experience
3-5
Heya,

Does anyone know how to alter which field a certain group sorts on? Sofar I've tried using

VB.NET:
reportDocument.DataDefinition.SortFields.Item(reportDocument.DataDefinition.GroupNameFields.Count).Field = reportDocument.DataDefinition.SortFields.Item(7).Field
reportDocument.DataDefinition.SortFields.Item(reportDocument.DataDefinition.GroupNameFields.Count).SortDirection = SortDirection.DescendingOrder

The last group on my report is the one I'm trying to sort by hence the
VB.NET:
reportDocument.DataDefinition.GroupNameFields.Count
in the .Item()

But I get an error on the 1st line telling me the sorting already exists... All I want to do is tell the group that contains field (7) to sort Asc or Desc...

Anyone have any ideas?
 
Back
Top