andrewwatson
Programmer
I've got a report (CR 4.6) that I'm controlling from VB(6) using crystl32.ocx. I want to control the grouping depending on parameters entered in the VB program.
I've been able to change the groups using formulae, but can't figure out how to get them sorted in descending order.
Groups are @Group1, @Group2
From VB, I change the fields being grouped on by using:
rpt.Formulas(0)="Group1 = {Query.Name}" etc
For the sort order, I've tried:
rpt.GroupSortFields(0)="-{@Group1}"
and
rpt.GroupSortFields(0)="-GroupName({@Group1})
and
rpt.GroupSortFields(0)="-{Query.Name}
all of these give the error "Invalid Field Name"
Any help would be greatly appreciated.
I've been able to change the groups using formulae, but can't figure out how to get them sorted in descending order.
Groups are @Group1, @Group2
From VB, I change the fields being grouped on by using:
rpt.Formulas(0)="Group1 = {Query.Name}" etc
For the sort order, I've tried:
rpt.GroupSortFields(0)="-{@Group1}"
and
rpt.GroupSortFields(0)="-GroupName({@Group1})
and
rpt.GroupSortFields(0)="-{Query.Name}
all of these give the error "Invalid Field Name"
Any help would be greatly appreciated.