Sometimes subreports aren't the best answer - they take extra processing and create a second connection to the database.
You could modify your groups. I would break this down into 4 formulas, something like this:
DateGroup IF {?DATE}='E' THEN toText({gm_rpt_AdjustmentWriteOff;1.ENTRYDATE}, 'yyyyMMdd') ELSE IF {?DATE}='P' THEN toText({gm_rpt_AdjustmentWriteOff;1.PAYDATE}, 'yyyyMMdd')
WriteoffGroup IF {?GROUP} = 'R' THEN {gm_rpt_AdjustmentWriteOff;1.RDOC} ELSE IF {?GROUP} = 'P' THEN {gm_rpt_AdjustmentWriteOff;1.PROV} ELSE if {?GROUP} = 'F' THEN {gm_rpt_AdjustmentWriteOff;1.FACILITY} ELSE IF {?GROUP} = 'N' THEN 'ALL'
Group1 If {?DETAILS} = 'Y' then mailto:%7b@DateGroup - {@DateGroup } else mailto:%7b@WriteoffGroup - {@WriteoffGroup }
Group2 If {?DETAILS} = 'Y' then mailto:%7b@WriteoffGroup - {@WriteoffGroup } else ' '
You can use any string in the else of Group2.
Because formulas always have to have the same data type in the result, you have to convert your date fields from your current Group1 to a string. If your dates will span multiple years, you have to use the 'yyyyMMdd' format, otherwise they won't sort correctly. For example, with 'MM/dd/yyyy' format you would have the following order:
01/01/2007
02/01/2005
12/01/2006
but in 'yyyyMMdd' format you get:
20050201
20061201
20070101
-Dell
------------- Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics
|