Aug 16, 2002 #1 68686868 Programmer Aug 16, 2002 1 US How Can I use RecordSortFields of CrViewer control of Crystal Report 8.5 in VB 6 code? I want to sort at runtime. Thanks
How Can I use RecordSortFields of CrViewer control of Crystal Report 8.5 in VB 6 code? I want to sort at runtime. Thanks
Nov 30, 2002 #2 Jengo Programmer Apr 17, 2000 100 US Dim myApp As New CRAXDRT.Application Dim myRpt As New CRAXDRT.Report Dim sTemp As CRAXDRT.DatabaseFieldDefinition Set myRpt = myApp.OpenReport("myreport.rpt" Set sTemp = myRpt.Database.Tables.Item(1).Fields.Item(2) myRpt.RecordSortFields.Add sTemp, 0 ----------------------------------------- This line: (myRpt.Database.Tables.Item(1).Fields.Item(2)) means sort by the first table second column. This line: (myRpt.RecordSortFields.Add sTemp, 0) means sort by field specified and sort asc. 0 = asc and 1 = desc Hope this helps! Upvote 0 Downvote
Dim myApp As New CRAXDRT.Application Dim myRpt As New CRAXDRT.Report Dim sTemp As CRAXDRT.DatabaseFieldDefinition Set myRpt = myApp.OpenReport("myreport.rpt" Set sTemp = myRpt.Database.Tables.Item(1).Fields.Item(2) myRpt.RecordSortFields.Add sTemp, 0 ----------------------------------------- This line: (myRpt.Database.Tables.Item(1).Fields.Item(2)) means sort by the first table second column. This line: (myRpt.RecordSortFields.Add sTemp, 0) means sort by field specified and sort asc. 0 = asc and 1 = desc Hope this helps!