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]

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 7:38PM
    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

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.