Yes, the display will work in the crew group section, but I later realized that you are better off if you can create an actual group based on your horizontal "group" formulas. (Although you could leave the report as is and skip to my suggestion below about the subreport, just using the formula below in the subreport only.) What you would do is combine all your horizontal formulas into one formula {@grpname}, by doing the following:
If {pPMPERDET.COMPLETION_STATUS} = "X" AND {pPMPERDET.END_DATE_TIME} < {pPMPERDET.LATEST_DATE} AND {pPMPERDET.MAINT_ACTION_CODE} = "P" then
"Group 1" else //replace "Group 1" with descriptive name
If {pPMPERDET.COMPLETION_STATUS}) = "O" AND (
(
{pPMPERDET.INTERVAL_LENGTH = ''} OR {pPMPERDET.SCHEDULED_DATE = '0'}
) then //not sure how you want the clauses set off with parens,
//but you need some here
"Group 2" else
If {pPMPERDET.COMPLETION_STATUS} = "X" AND {pPMPERDET.MAINT_ACTION_CODE} = "P" then
"Group 3" else //etc.
You can then use {@grpname} as your column field in a crosstab, and use {table.crewunit} as your row field, with count of some recurring field as your summary. This crosstab would be placed in the Area Group header or footer. There is no need for a group on crewunit.
Next you would insert a subreport that again uses the formula {@grpname}. This time you would insert a group on the formula and add all detail fields that you wanted displayed. Go to the subreport section expert->group footer for {@grpname}->new page after->x+2 and enter:
not onlastrecord
Then place the subreport in the Interval group footer (since you want the detail records to cross areas), and link the subreport to the main report on matching fields for region, sector, and interval.
-LB