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!

Group formula

Status
Not open for further replies.
Jun 10, 2004
58
US
This is probably extremely simple, but I'm totally drawing a blank! I have a field that's in the group details section of my report. What I want to do is create a report footer and use this field within the report footer ONLY IF it matches certain criteria. Can someone tell me how to create the formula that will cause this field to display in the report footer if it matches my criteria? Thanks!
 
Right click the field and select format. Click on the X-2 button to the right of the suppress checkbox and enter a formula:

if <<insert condition here>> then true

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Shouldn't there be a value for "true?" All I want it to do is print if the conditions are met. Here's what I'm trying to do:

if {Task.Version} = "8.1 SP1.5.1" and {Task.Build} = "8" then true
 
Can someone please help me with this formula? I need it pretty quickly! Thanks!!
 
Similar to dgillz idea:

Right click the field and select format, then click the X-2 button for the suppress box. Enter the formula:

{Task.Version} = "8.1 SP1.5.1" and {Task.Build} = "8"

You shouldn't need the if ... syntax in this case.

Crystal will suppress the field when the above criteria are met.
 
Agreed, you do not need if then syntax, just a formula that evaluates to true or false.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
I understand that logic; however, I use the TaskID field in another area of the report where I don't want this formula applied. The TaskID is used in the Details section (and I don't want any criteria applied to that one), and the 2nd instance of the TaskID field will be in the Report Footer section, where I do want the criteria/formula applied.

How do I do this?
 
I've got a field named @RevHistory that contains this formula:

{Task.Version} = "8.1 SP1.5.1" and {Task.Build} = 8

When I run the report, I don't get a list of tasks that meet this criteria; instead, I get the word "False.
 
If you have 2 (or more) instances of the field on the report then just put the formula in on the instance where you want it to work (i.e. the report footer section).

Crystal treats the 2 instances as separate fields.

Just give it a go...
 
I put it in the Report Footer section (the @RevHistory field), and the only result I get is "False."

Thanks for your help!
 
Sorry, it's Friday afternoon and I think my brain is fried...

You don't need to create a formula in it's own right - just add that bit of code to the suppress format of the field just like dgillz first suggested.
 
It's Friday, we're all confused...

Right click on your second instance of your TaskID field in the report footer, select Format Field and then choose the Common tab. Click on the X-2 button to the right of where it says suppress and in the window that appears enter:

{Task.Version} = "8.1 SP1.5.1" and {Task.Build} = "8"

in the main section. Click on save and close. Click on OK in the format editor.

This should get you what you want. You don't need to use your @RevHistory field.
 
OK, that makes sense!

One more question before I've totally worn you out on this Friday afternoon . . . what if I wanted to create a 2nd instance of TaskID and enter specific task numbers for this field? How is that done?
 
I think you should explain what you are trying to do. Putting a detail record in the report footer will only pick up the last instance of that field that occurs in the detail section. Ordinarily, summary fields are placed in the report footer.

-LB
 
OK, I've got a list of "tasks," each with a task number. In the detail section, I want to include the TaskID, Description, etc. -- all individual fields. That all works fine. What I want in the report footer is to be able to list specific task numbers and their associated description.

Does that make sense?

Thank you all very much for your help!
 
If you want to repeat a subset of the details in the report footer, then the simplest approach might be to insert an unlinked subreport that has the same record selection formula as the main report except that you are adding the following to your record selection formula:

{Task.Version} = "8.1 SP1.5.1" and {Task.Build} = 8

I'm assuming you mean the report footer, even though your thread title refers to a "group formula".

-LB
 
In my subreport, this is what I'd want:

Task ID and Task Description (two columns)

The TaskID tasks would be comprised of the task numbers I explicitly enter.
 
Via parameter? Then create a parameter {?ID} and in the record selection formula of the subreport, add:

{?ID} = {table.ID}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top