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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use RecordSortFields in CrViewer control in vb6

Status
Not open for further replies.

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
 
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!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top