Results 1 to 3 of 3

Thread: CR.GroupSortFields(0) --- problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2007
    Posts
    24

    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??

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: CR.GroupSortFields(0) --- problem

    Moved to Reporting

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width