I am new to CR11 and am updating VB6 code that used the CR8 OCX control. Using the OCX, I passed the sort field with the following code:
CR.sortfields(0)="+{orders.CUSTOMER}"
In CR11 I understand that you would use the following code:
dim crxDBField as craxdrt.databasefielddefinition
set crxdbfield=report.database.tables.item(1).fields.item(8)
report.recordsortfields.item(1).field=crxDBField
However, this assumes that you know table 1 ="orders" and field 8="customers". Is there a better way of determining the table and field numbers without cycling through the descriptions at runtime. The sort order is determined at runtime by the end user so it cannot be hard coded in the report.
CR.sortfields(0)="+{orders.CUSTOMER}"
In CR11 I understand that you would use the following code:
dim crxDBField as craxdrt.databasefielddefinition
set crxdbfield=report.database.tables.item(1).fields.item(8)
report.recordsortfields.item(1).field=crxDBField
However, this assumes that you know table 1 ="orders" and field 8="customers". Is there a better way of determining the table and field numbers without cycling through the descriptions at runtime. The sort order is determined at runtime by the end user so it cannot be hard coded in the report.