I have a header and detail table.
Based on conditions, I may or may not print detail lines. Therefore I need to know when a detail line was printed in order to print related header line. Report looks like this:
GF2 - detail line 1a (printed)
GF2 - detail line 1b (printed)
GF1 - detail header 1 (printed)
GF2 - detail line 2a (no print)
GF1 - detail header 2 (no print due to no GF2)
GF2 - detail line 3a (printed)
GF2 - detail line 3b (no print)
GF1 - detail header 3 (header line should print due to line 3a printed, but evaluation of controlling flag gets overriden at GF2 time)
...
I tried to overcome problem by using a shared variables (in GF2) hoping that second time around "Shared StringVar ph" would retain it's original value:
// set flag to print header data
Shared StringVar ph;
//
// if not yet set to print from another task
if (ph = "N" or ph = "") and
({?Report Details} = "No Due Date" and s = "No Due Date") or
({?Report Details} = "Schedule" and s = "Due Now") or
({?Report Details} = "Tasks Closed" and s = "Task Closed") or
(
({?Report Details} = "Tasks Closed" and s = "Task Closed" and
({aualdocs.fmt_acc} <> Previous({aualdocs.fmt_acc}) or
({aualdocs.fmt_acc} = Previous({aualdocs.fmt_acc}) and {aualtask.rea_cde} <> Previous({aualtask.rea_cde}))))) or
({?Report Details} = "Overdue" and s = "Overdue")
then ph := "Y"
else ph := "N";
// set variable status
ph;
Any suggestions will be much appreciated.