?
Solved

Crystal Reports: Cross-Tab Group Options > Use a Formula as Group Sort Order

Posted on 2011-02-18
4
Medium Priority
?
2,888 Views
Last Modified: 2012-05-11
I have a cross-tab report where each row is for one customer type.  However, I only want to look at two customer types.  Either dealer or not dealer.

I wrote to formulas:
Dealer
{CUST.CTYPE} = "D"

Direct
{CUST.CTYPE} <> "D"

I right click on Row #1 Name and choose Row Options > Group Options...
In Cross-Tab Group Options I check Use a Formula as Group Sort Order and click x+2.
In the Formula Workshop - Group Sort Order Formula box, I cannot figure out what to do with my formulas.

If I put them both in the edit box,
   {CUST.CTYPE} = "D"
   {CUST.CTYPE} <> "D"
I get this error:
   A constant expression is required here.

How do I actually place my formulas in the edit box.  I tried using the formula names as well.
   @Dealer
   @Direct
And got this error:
   The remaining text does not appear to be part of the formula.
 
0
Comment
Question by:cgettel
  • 2
  • 2
4 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 34927448
The formula for Sort Order is looking to get crAscending, crDescending, crOriginalOrder to tell which sort order to use.

You could try using SPECIFIED ORDER but that would require you to specify the correct order.

You could add a formula like
If {CUST.CTYPE} = "D" then
    "Dealer - " & {CustomerNameField}
Else
    "Direct - " & {CustomerNameField}

You can then use the 2nd tab and use the CustomerNameField as what is displayed.

mlmcc

0
 

Author Comment

by:cgettel
ID: 34927512
Ah, so I uncommented the crAscendingOrder that was already in the edit box when I pulled it up.

Then I added
If {CUST.CTYPE} = "D" then
   "Dealer - " & {Dealer Sales}
Else
   "Direct - " & {Direct Sales}

x+2 give this error:
   The remaining text does not appear to be part of the formula.

I'm going to lunch.  I'll check back in an hour.

thanks mlmcc.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 34927995
No, you need to create a new report formula through the field explorer.

Then instead of using the the {CUST.CTYPE} field in the cross tab use the new formula.

Since you want just the 2 groups use this formula
If {CUST.CTYPE} = "D" then
   "Dealer"
Else
   "Direct"

mlmcc
0
 

Author Closing Comment

by:cgettel
ID: 34928237
Thank you!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question