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

CustomSort in macro

Status
Not open for further replies.

ssudha

Technical User
Oct 14, 2002
62
IN
Hi,
If i place the below statement in macro where i am building my query....what should happen...

busobj.ActiveDocument.DataProviders.Item("Query 1 with lead").Columns(1).CustomSort ("Descending")


I don't see any change, i want the data to be sorted in descending order and should be handled in a macro only.
I am actually working on dynamically accepting the criteria(Column) on which the sort should be done in the report and sort the data on that particular column accordingly.

Any help regarding this is appreciated.

Thanks in advance.
 
Any idea what version of Crystal you're using?

Did you mean to post in a VBA forum?

Crystal doesn't have macros, nor could it process this statement.

To dynamically sort, most use a parameter and then use a formula to sort on, such as:

if {?SortParm} = "Title" then
{table.title"
else
if {?SortParm} = "Last Name" then
{table.lname"
etc...

-k
 
In this formula, how can I specify that I need to sort in a Descending order for {table.title}?

I am working in Crystal 10 using SQL Server database.

Thanks!

if {?SortParm} = "Title" then
{table.title"
else
if {?SortParm} = "Last Name" then
{table.lname"
 
Make this into two formulas:

//{@Title}:
if {?SortParm} = "Title" then {table.title} else ""

//{@LastName}:
if {?SortParm} = "Last Name" then {table.lname} else ""

Add each to the record sort area and check descending for {@Title} and ascending for "Last Name".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top