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

Crystal Reports Grouping Problem

Status
Not open for further replies.

21128

Programmer
Aug 27, 2009
36
US
I want to group the report based on company_id.
If company_id equals to 1 or 2 or 3 then the group will be called A
If company_id is not equal to 1 or 2 or 3 then the group will be called B
How do i create a third one which includes entire company_id which might be called C

My code is

if {sl_companies.company_id} in [14788, 32700, 19402] then
"A"
ELSE IF NOT({sl_companies.company_id} in [14788, 32700, 19402]) THEN
"B"
ELSE
"C"

It results me two group A and B. I want to have C as well.

Any help is highly appreciated.
Thanks
 
Sorry i have the following code:

if {sl_companies.company_id} in [1, 2, 3] then
"A"
ELSE IF NOT({sl_companies.company_id} in [1, 2, 3]) THEN
"B"
ELSE
"C
 
You can't use the same details in more than one group.

What you can do is export your report under some other name, then re-import it as a subreport in the main report footer. Adjusting to all be Group C.

Another option is a Cross-Tab, which can show all of the data with a different grouping in the main report. It might suit your needs, depending on what you are after.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Do you see that there IS no "C" value? Your first two clauses are the equivalent of "A" or "not A"--there IS nothing else. So you need to define what belongs in each of the three conditions more clearly.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top