Help - Search - Members - Calendar
Full Version: Help with conditional grouping
Fast Reports forum > Fast Reports Products > FastReport 4.0
tbenci
Good morning all,

I am trying to emulate a grouping function I can do easily in Crystal. Given I am finding Fast Reports a more than adequate Crystal replacement I am sure this is just me not understanding how to do it rolleyes.gif .

OK I have a dataset of contact records. There is a creation_date and I have created a field in the SQL that is called contact_age and is calculated by subtracting the creation_date from today's date.

I want to group by contact_age and I want four specific breaks; 1-14, 15-21, 21-30 and 30+. Further, as a report footer I want an analysis of total numbers in these age groups.

I thought I would simply greate 4 groups and set the conditions contact_age<=14 on one, contact_age>14 and contact_age<=21 on another etc.

This worked BUT it printed all the bands. I then did a before print condition to hide the bands which seemed to work fine.

Is this the best approach or is there something I am missing?

BTW, great product and I am really happy I found it.

Regards
Tony Benci
gordk
you might want to create another calc field that assigns integer value
ie 1 for 1 to 14 of contact age,
2 for 15 to 21
3 for 22 to 30
4 31+
use that field for condition of group header
and you should only need 1 grpheader, 1 mdata, 1 grpfooter
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.