Apologies in advance if this is in the wrong place.
I've been wrestling with a report (Crystal 11) for over a day now and I'm at my wit's end.
The report is essentially a customer account statement, showing invoices (type I) and payments (type P) in the detail section and outputting a balance in the page footer.
What I also need to do in the page footer is use a formatting formula to display a red 'overdue' stamp if the earliest invoice item was before a certain date.
So, what I've done is:
1. In the report header, add the global declaration:
Global DateVar FirstInvoice;
2. In the detail section, add this formula to catch the date of the earliest invoice item:
Local DateVar Dummy; // test for an unitialised variable
Global DateVar FirstInvoice;
IF {TransactionsTable.transactionType} = "I" Then
IF FirstInvoice = Dummy Then
FirstInvoice := {TransactionsTable.transactionDate}
ELSE IF DateDiff("d",{TransactionsTable.transactionDate},FirstInvoice) > 0 Then
FirstInvoice := {TransactionsTable.transactionDate};
3. In the page footer, attempt to output the value of the global (I was trying to work with it initially, but fell back to just outputting it because it wasn't working - it still isn't

)
Global DateVar FirstInvoice;
FirstInvoice;
The formula in the details section outputs the correct value i.e. that of the earliest invoice item, but when we get to the page footer, nothing's output at all - the variable is empty.
I'm pretty sure this is down to my unfamiliarity with Crystal, but I can't seem to find an answer to the problem. Could anyone point me in the right direction, please?
Best,
Hart
Edited by Hartley - 22 Mar 2012 at 3:45am