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!

How to suppress printing a group 2

Status
Not open for further replies.

hchau

Programmer
Jan 20, 2011
9
US
I have these groups of data

Group1
open 2011/04/04 12:00 AM
alert 2011/04/04 03:00 AM
resolved 2011/04/05 08:00 PM

Group2
open 2011/04/04 12:00 AM
alert 2011/04/04 03:00 AM

Group3
..
..

Group4

I only want to print out the group that does not have the line "resolved". Is there a way to suppress printing Group1?

Thank.
 
You don't mention how your tables are set up, but let's see if I can explain this. For this example, I'm going to assume the following table structures:

Issues
Issue_ID
Description

Actions
Issue_ID
Action
Action_Date

1. Add both tables to your report.

2. Add a second copy of Actions - when you do this, Crystal will tell you that the table is already in the report and ask if you want to use an alias - click on Yes or OK (I don't remember which it is). Your second copy of Actions will appear with the name Actions_1.

3. Link from Issue to Actions on Issue_ID. Also link from Issue to Actions_1 on Issue_ID.

4. Group by either {Issue.Issue_ID} or {Issue.Description}.

5. In the Select Expert, add select {Actions.Action} is equal to "resolved".

6. For the detailed data in your report, use the appropriate fields from Actions_1.

This process will find all of the issues that have a "resolved" action (Actions table) and display all of the actions that have taken place for the issue (Actions_1 table).

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Another approach would be to create a formula {@Resolved}:

if {table.status} = "Resolved" then 1

Then go to report->selection formula->GROUP and enter:

sum({@Resolved},{table.groupfield}) <> 0

Please note that you are in the wrong forum. Questions like this should be asked in forum149 or forum767.

-LB
 
Thank you for the quick response.

As far as setting up a Formula, it is a simple way and works fine for the group with "Resolved".

If I want the group without "Resolved", I thought I flip the statement from 1 to 0 like below
if {table.status} = "Resolved" then 0
But it prints out both groups instead.

 
Sorry, no, leave the formula as I originally showed. Just change the group selection formula to:

sum({@Resolved},{table.groupfield}) = 0

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top