Help with conditional grouping
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 [img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="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[/img]
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 [img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="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[/img]
Comments
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