Results 1 to 2 of 2

Thread: Change Sort Field in Runtime

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Change Sort Field in Runtime

    HI

    How can I to change sort field in runtime ?

    I am using CRAXDRT

    Tks

  2. #2
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: Change Sort Field in Runtime

    Try something like this...
    VB Code:
    1. Dim crFormulaField As CRAXDRT.FormulaFieldDefinition
    2.     Dim crApp As CRAXDRT.Application
    3.     Dim crReport As CRAXDRT.Report
    4.  
    5.     Set crApp = New CRAXDRT.Application
    6.     Set crReport = crApp.OpenReport("your report here")
    7.     '
    8.     '   Set the field to sort by
    9.     '
    10.     Set crFormulaField = crReport.FormulaFields.GetItemByName("name of the field to sort by")
    11.     crReport.RecordSortFields.Add crFormulaField, crAscendingOrder
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

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