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

filter records that have zero across all fields 1

Status
Not open for further replies.

MICKI0220

IS-IT--Management
Jul 20, 2004
337
0
0
US
I am fairly new to crystal reports. Here is the situation. We use a canned program that creates crystal reports. I can modify the reports but the data coming in is something I cannot change on the backend. Basically the crystal reports data is a temp table that is created by a procedure and I cannot alter the requirements only the way the report uses the data.
My question is this. I have group on the report, within each groups detail are categories. How can I suppress these categories based on their name and not allow the sum, to sum up their values. For example. Under the group Tank Material, there are 5 sub groups or detail records. TM10, Tm20, Tm30 etc. I want to suppress TM20 and TM30's along with their values. I hope that make sense. How do I do this. I am using Crystal Reports XI

Thank you in advance

Micki
 
you could change the selection criteria to exclude the TM20 & TM30 values.

select expert -> New -> your fields -> not one of -> enter desired values
 
I must apologize, that issue was what I thought my user wanted and now they have clarified it once I made the change. They want two field values in a record to change if the costcode is TM10 etc. My code is something like this

Code:
WhileprintingRecords;
if {Report.CostCode} = "TM10" Then
{Report.ActualQuantity} = 0 and 
{Report.EstQuantity} = 0

I need these values evaluated before it sums up the group. Can you tell me what is wrong with my code. I have it under group selection selection formulas.
Right now it deletes all my records from the report.
 
You should create a separate formula for each quantity, like this:

//{@Actualqty}:
if {Report.CostCode} = "TM10" Then
0 else
{Report.ActualQuantity}

//{@estqty}:
if {Report.CostCode} = "TM10" Then
0 else
{Report.EstQuantity}

Place each formula in the detail section instead of the corresponding quantity field, and then right click on each and insert a sum at the group level.

-LB
 
and what if I have multiple costcodes to do the same thing to....for example

Code:
//{@Actualqty}:
 if {Report.CostCode} = "TM10" or "TM20" OR "CF10" Then
 0 else
 {Report.ActualQuantity} 

//{@estqty}:
 if {Report.CostCode} = "TM10" or "TM20" OR "CF10" Then
 0 else 
{Report.EstQuantity}
 
lbass

I don't understand how you place a formula in the detail section instead on the record or group section?
 
Like this:

//{@Actualqty}:
if {Report.CostCode} in ["TM10","TM20","CF10"] Then
0 else
{Report.ActualQuantity}

You create the formulas in the field explorer->formulas->new and then drag them onto the detail section.

-LB
 
I got it to work by placing it at the field level. Thank you for all your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top