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!

GROUPING ON PARAMETER DESCRIPTION

Status
Not open for further replies.

BRL123

Programmer
Apr 26, 2006
21
0
0
US
I am using Crystal 8 run through Delphi 7. I want to group the report by the description name that I typed in with the parameter list. Is this possible?
 
Not only is that not possible, it makes no sense.

In SQL, and in Crystal, grouping occurs on DATA, not on parameters. Have you ever heard of someone writting a stored procedure which groups on a parameter passed? parameters aren't data, sql groups on data.

To further annoy you, Crystal built in the description to allow for display, but you can't reference it in code (annoys me anyway).

So create a formula to group on, such as:

if {table.field} = 1 then
"My first group"
else
if {table.field} = 2 then
"My Second group"
else
"N/A"

Make sure that the names will sort properly alphabetically, or you can group by whatever field is appropriate and use the above formula for display purposes.

-k
 
Thanks.
My dilemna is that I am grouping on an inventorycode which consists of a locationcode(quarter and year). for example
50(Q106). The customer gets to the inventory code by matching 3 parameter (the location code, the quarter and the last 2 digits of the year )The customer wants me to display the city field associated with the location code as the group name.
I do not know a way to link the inventory table with the location table. I use the formula:
InvCode := trim({Inventory.INVCODE});
Left (InvCode,len(InvCode)-6)
to get to the locationcode and it will not let me group on the formula. I tried using this formula and passing it to a subreport where I get the city field. It works on my end but gives the customer an out of bounds error.
Any ideas?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top