CR.GroupSortFields(0) --- problem
I m using VB 6.0 with Crystal report 10.
i have created object for crystal report as objReport
im using following code in VB to sort the group field.
i hv grouped my report on Party_Code...i want same report to be sorted on Party Code or InvoiceAmount...
im trying to use the following code but its showing error SUBSCRIPT OUTOF RANGE....
objReport.GroupSortFields(0) = "Sum({@Amount}, {KC_PARTY_M.PARTY_CD})"
while debuging only in VB its giving an error. what could be the problem??
Re: CR.GroupSortFields(0) --- problem
Re: CR.GroupSortFields(0) --- problem
Well first off, GroupSortFields is a Collection and collections are 1 based.
In order to Add/Change a GroupSortField the report must have an existing Summary field. You then add the summary field to the collection.
oReport.GroupSortFields.Add oReport.SummaryFields(1), crDescendingOrder