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

Please help with groupping 1

Status
Not open for further replies.

alectek

Programmer
Jul 9, 2003
68
US
Please help.
I am running Crystal Reports 8.5 with a SQL 2000 database.
I created formula for internal grouping :
If {flag } = “Yes” then “Very Good” else “Not Very Good” .
Now, if external group doesn’t have any {flag } = “Yes” it will not show “Yes” for the internal group…
But I need to show message “Very Good” even the external group doesn’t have any records for it.

This is how I have right now:


(external group) Agency 1
(internal group) “Not Very Good”
(details) record 1
record 2
record 3
(external group) Agency 2
(internal group) “Very Good”
(details) record1
record 2
record 3
record 4
(internal group) “Not Very Good”
(details) record 1
record 2

This is how I need it:

(external group) Agency 1
(internal group) “Very Good”
(external group) Agency 1
(internal group) “Not Very Good”
(details) record 1
record 2
record 3
(external group) Agency 2
(internal group) “Very Good”
(details) record1
record 2
record 3
record 4
(internal group “Not Very Good”
(details) record 1
record 2


Thank you very much.
Alex.

 
I think you could do something like inserting an additional group header section and an additional group footer section for the inner group (let's call it "Rating").

1-In Group Header_a, place the string: "Very Good"
2-In Group Header_b, place the groupfield {table.rating}
3-In Group Footer_a, place the string: "Not Very Good"

Then create two formulas for the detail sections:

{@Yes}:
if {@flag} = "Yes" then 1 else 0

{@No}:
if {@flag} <> &quot;Yes&quot; then 1 else 0

Go to format section->Group Header_a->suppress->x+2 and enter:

sum({@Yes},{table.agency}) > 0 //where {table.agency} is your outer group field

Then format Group footer_1->suppress->x+2 and enter:

sum({@No},{table.agency}) > 0

I think this will work, although I couldn't really test it. This does assume that at least one detail appears per agency.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top