cancel
Showing results for 
Search instead for 
Did you mean: 

When showing SQL statement in [Database]-[ShowSQLQuery], only the first 2 definitions appears in the orderby query. (It should display all of the 4 definitions)

Former Member
0 Kudos

(1)Environment

  - Client: SAPCrystalReports2011(Windows7)

  - Server: Oracle11gR2(WindowsServer2012)

(2)Operations and Problem

  - Operation1:

     Set 1 group definition in [Report]-[GroupExport]

  - Operation2:

     Set 4 sorting definitions(including the group definition in Operation1) in [Report]-[RecordSortExport]

  - Problem:

     When showing SQL statement in [Database]-[ShowSQLQuery], only the first 2 definitions appears in the orderby query.

      (It should display all of the 4 definitions)

(3)Remark

  - This Problem occurs if I use a report-file that is created by CrystalReports4.0(1995Release) in SAPCrystalReports2011.

(4)Request

  - Please instruct me how to properly handle this issue.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Anzai,

Could you please elaborate on the 'definitions' part please?

-Abhilash

Answers (1)

Answers (1)

ido_millet
Active Contributor
0 Kudos

Your record sort is probably based on a Crystal formula. Since the DBMS has no clue about Crystal formulas, such sort directives are NOT passed to the DBMS. Instead, Crystal takes care of such Sort criteria after the data has been returned from the DBMS.

The same exact logic applies to the Record Selection formula (The WHERE clause in the SQL generated by Crystal).  You can use SQL Expressions (instead of Crystal formulas) to ensure Crystal can pass the condition to the DBMS. For example, if you sort by an SQL Expression rather than by a Crystal Formula, you would see something like this in the SQL:
ORDER BY `Orders`.`Customer ID`, `Orders`.`Employee ID`, {fn ABS(`Orders`.`Order Amount`)}