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

create a group based on if criteria 1

Status
Not open for further replies.

Eprice

Technical User
May 6, 2003
209
US
Hi,
Is there a way to create a report group depending on certain criteria. I am new to crystal reports, still learning. I have a due date field. If the due date is 1 then I want to group by Job but if the due date is anything else but 1, I want to group on Flowchart. I have no idea, thinking I would use an If formula but where and how.
Lisa
 
Hi,
Create a formula ( as you thought) like:

If {DueDateField} = 1 then
{Job}
Else
{Flowchart}

Using the Insert Group menu choice, select that formula to group on.

(If the due date field can be NULL test for that first)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Crystalkiwibruce is correct - you can't mix types. You will have to cast your date and number fields to be a text field. Since you mentioned you are new to crystal reports, you can accomplish this by using the totext function. So, your formula would look something like:

If totext({DueDateField}) = '1' then
{Job}
Else
{Flowchart}

 
It works but I can't add any formatting space between the groups. I'd like them to be seperated a little for easier vieiwing on the report.
Lisa
 
If you inserted a group on your formula, if you want to add space, you can insert additional group header or group footer sections or you can stretch the height of the current group header section.

-LB
 
The space worked for me when I went to change group and selected keep together instead of right clicking, going to section expert and selecting keep together. Now just adding some space in the group footer part adds space to make the report more readable. I'm still learning a lot about crystal reports and you'll probably hear from me again soon. Thanks for all your help.
Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top