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!

Group Sorting in Crystal Reports

Status
Not open for further replies.

wesmk

Technical User
Aug 17, 2004
15
US
Trying to have a function that says if parameter = container make group#1 {tablename.container_name} else if parameter = vessel make group#1 {tablename.vessel_name. I want the user to be able to view report either by the container name within the vessel name or by the vessel name within the container name thanks for any suggestions
 
You pretty much have it.

Create a formula which contains:

if {?parameter} = "container" then
{tablename.container_name}
else
{tablename.vessel_name}

This is a simplified version that assures that the formula ALWAYS returns a value, you add additional ELSE IFS if need be.

-k
 
If you want to user to decide how the report is to be viewed, you can do the following:

1) Change your Parameter to a pick list with "Container" and "Vessel" as the options

2) Create a formula named group and add this

Select {?parameter}
case "Container" : {tablename.container_name}
case "Vessel" : {tablename.vessel_name}

3) Insert a group based on @group

This method can be used for several layers of user defined groupings.

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top