Normal Topic XResultSetSort does not seem to work properly (Read 955 times)
Andy
Member
*
Offline



Posts: 39
Location: Massachusetts
Joined: Aug 26th, 2014
XResultSetSort does not seem to work properly
Nov 8th, 2016 at 9:54pm
Print Post Print Post  
It appears that the following sort spec does not sort properly. 

XResultSetSort(vRSID, "Acct:1;Invoice:1")

Both elements are number fields.  The sort spec works for the account number (Acct) in descending order but the invoice number seems to be sorting by ascending order. The full spec is below in blue print.
Any help would be appreciated.

     if vMarker= 1            
     {
           vRSID = @XResultSetSearch(@FN, "Customers!Service!LineItems", 0, 2, "!Description=" + vDescrip, "!Description=" + vDescrip2, "!Description=" + vDescrip3, "!Amount=" + vAmt, "!Acct=" + vList1, "!Acct=" + vAcctNo, "!Acct=>100")
           if vRSID > -1
           {
           XResultSetSort(vRSID, "Acct:1;Invoice:1")
           vCount = @XResultSetTotal(vRSID)
           
                 If vCount > 0
                 {
                 For n = 1 to vCount
                 @Msg("Searching thru " + n + " service ticket line items records")
                 XResultSetCurrentPosition(vRSID, n)
                 vVal = @int(@XResultSetValue(vRSID, "Acct"))
                 
                       if n < vCount
                       {
                       vList += vVal + ";"
                       }
                       Else
                       {
                       vList += vVal      
                       }
           
                 next
                 }//end if vCount > 0
           
           vFN = VList
           vFN = @XResultSetPrintReport("Service Line Item", vRSID, 1)
           XResultSetClose(vRSID)
           }// end if RSID > -1
     
     }// end if vMarker = 1
  
Back to top
 
IP Logged
 
Andy
Member
*
Offline



Posts: 39
Location: Massachusetts
Joined: Aug 26th, 2014
Re: XResultSetSort does not seem to work properly
Reply #1 - Nov 9th, 2016 at 7:48pm
Print Post Print Post  
I solved the problem.  Issue was in the report.  Thanks
  
Back to top
 
IP Logged