Print Page | Close Window

SortDirection not working

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4617
Printed Date: 04 May 2024 at 2:31am


Topic: SortDirection not working
Posted By: mc_tiger
Subject: SortDirection not working
Date Posted: 24 Oct 2008 at 12:48pm
Ok I am using Crystal report X and asp.net 2008.
 
I need to dynamically select a sort criteria from the asp page based on the user input.  So I created two formulas(order_by1, order_by2).  I then set these fields in the Record Sort Expert. 
 
In the .Net code, I am able to set the formula for order_by1 and order_by2 to a certain field that the report should be sorted on.  This works fine. 
 
If I try and change the SortDirection on the SortField I get an error "Cannot change the sorting field of a sort object."
 
If I hardcode the sort values in the Record Sort Expert then I am able to set the SortDirection in code, but can't change the field names of the sort fields.
 
So what am I doing wrong?
 
Thanks.



Replies:
Posted By: mc_tiger
Date Posted: 27 Oct 2008 at 6:08am
bump


Posted By: BernieHunt
Date Posted: 09 Nov 2008 at 7:14pm
I don't know the answer to your method, but you may want to sort the records before you give them to Crystal. It will operate much quicker and you'll have much better sorting control without having to worry about the Crystal syntax.
 
Bernie
 



Print Page | Close Window