Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort order not working

Status
Not open for further replies.

mmaz

Programmer
Nov 22, 2000
347
Hi,

I'm trying to change the sort order of my report fields at runtime. I'm calling CR 8 report from an ASP, and this report is connected to a .ttx file (Data Definition file). I'm passing a recordset. I'm not getting any error message, but the records are just not being sorted. Here's my code:
-------------------------------------------------------
set myReport = session("oRpt")
set Database = myReport.database
set Table1 = Database.Tables.Item(1)

if session("selectedSortOrder") = "Date" then
set SortOrderField = Table1.Fields.Item(1) (Date field)
else
set SortOrderField = Table1.Fields.Item(3) (Name field)
end if

myReport.RecordSortFields.Add SortOrderField,1 (ascending)
--------------------------------------------------------

Any help would be appreciated. Thanks in advance!

Marie :)
 
Found my mistake. Ascending order code is 0, not 1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top