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!

I’ve been using Crystal Reports wit

Status
Not open for further replies.

ImDenise

Programmer
Feb 1, 2001
1
US
I’ve been using Crystal Reports with the Pubs database on MS SQL 7, and the table called titles for practice. I have a question about Group Sections. Let’s say that I created 3 group sections called Group #1, Group #2, and Group #3 for my report. I need the sections to print based on criterias. How and where do I set up my criterias?

My criterias are as follows:

If titles.advance=5000 then Group #1
If titles.advance=5000 and titles.type=business then Group #2
If titles.type=UNDECIDED or titles.advance=0 then Group #3


My titles table are the following:
title_id type pub_id price advance royalty ytd_sales
BU1032 business 1389 19.99 5000 10 4095
BU1111 business 1389 11.95 5000 10 3876
BU2075 business 736 2.99 10125 24 18722
BU7832 business 1389 19.99 5000 10 4095
MC2222 mod_cook 877 19.99 0 12 2032
MC3021 mod_cook 877 2.99 15000 24 22246
MC3026 UNDECIDED 877
PC1035 popular_comp 1389 22.95 7000 16 8780
PC8888 popular_comp 1389 20 8000 10 4095
PC9999 popular_comp 1389
PS1372 psychology 877 21.59 7000 10 375
PS2091 psychology 736 10.95 2275 12 2045
PS2106 psychology 736 7 6000 10 111
PS3333 psychology 736 19.99 2000 10 4072
PS7777 psychology 736 7.99 4000 10 3336
TC3218 trad_cook 877 20.95 7000 10 375
TC4203 trad_cook 877 11.95 4000 14 15096
TC7777 trad_cook 877 14.99 8000 10 4095

Any Suggestions?
Thanks,
Denise

 
You can try this:
create a formula in your report:

if titles.advance=5000 then
1
else if titles.advance=5000 and titles.type="business" then
2
else if titles.type="UNDECIDED" or titles.advance=0 then
3
else
4

and group by this formula.
Group 4 will gather everything that didn't fall under first three conditions of the "if" statement. You can work around it by selecting "in specified order" option in the Eroup Expert and naming your groups accordingly.
 
I like the following better. One thing is that you can't put the first group first, because it will inlcude everyone in the second group. Also, by using the actual names of the groups you don't have to bother with specified order.

if titles.advance=5000 and titles.type = "business" then "Group #2" else

if titles.advance=5000 then "Group #1" else

if titles.type="UNDECIDED" or titles.advance = 0 then "Group #3" else

"Other" Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top