views:

27

answers:

1

I am fixing some old reports and have come across the method GroupName. I cannot find exactly what it does and am coming for support. For that matter, is there an online reference that contains a list of the built it methods in CR, parameters, etc.?

+2  A: 

GroupName just returns a string of... well, the current Group Name. This is either just the field you were grouping on, or is a value customized via the Group Expert -> Options (Change Group Options) -> "Customize Group Name Field". It's whatever displays in the group tree.

If it's not listed in the Crystal Reports Online Help, which is oddly the case with GroupName, then your best bet is some good, old-fashioned Googling. I'm not sure of any resource other than commercial products that lists descriptions and usage instructions for all the functions, properties, etc.

EDIT: You have to pass the field you're grouping on. So, for a random example, GroupName(Patient.Patient_Type_Code) might return strings "Therapy", "Rehab", etc. from a numeric type code you're grouping on.

Ryan
I'm seeing GroupName used as if (GroupName(Calendar.SomeDateField), "event name") = month(currentdate) then ... In this case, what does GroupName return?
rodey
When you group on a date, Crystal gives you options (again in the Group Expert -> Options) as to how you want that date handled in the grouping such as "for each day", "for each week", "for each month", etc. So when you reference the group in a formula, it's not enough to just pass the field you're grouping on. You need to also specify how you're handling that field. If I was grouping on a birthdate field, but doing so by months, I would need to refer to the group name as GroupName(person.birthdate, "monthly")
Ryan