Generally VPE reports use the DataFlex finding mechanisms to run a report. You specify the main file and the sort order and the report class automatically finds the records form the database.

Sometimes it is a bit tricky to specify which records to use. THe array feature in VPE for DataFlex allows you to simply fill an array object with the records you want to report on and also sort them in any way you wish.

// instruct VPE for DataFlex to use array
Set pbUseRecnumArray to True

// DoFillRecnumArray called to fill the array at star5t of report
Procedure DoFillRecnumArray 
    
    // call AddRowIDToArray for each row
    Send AddRowIDToArray "SOrtValue" (GetRowId(customer.file_number))

    // Sort the array
    Send SortRecnumArray Ascending
End_Procedure