>I have a table used in report with two fields SOMEDATE and SOMENUMBER.
>
>I have made group by SOMEDATE in report.
>
>I want in group footer to show total SUM of SOMENUMBER for dates before date that is current in group.
>
>How to do that? (preferably it would be variable)
First, let me make sure I completely understand what you want. If you have the following data ... you want to see the following subtotals ...
1/1/06 10
20
--
This Total: 30 Prior Total: 0
1/2/06 5
10
15
--
This Total: 30 Prior Total: 30
1/3/06 15
20
5
--
This Total: 40 Prior Total: 60
Okay .. so assuming I understand your problem and you are looking for the "Prior Total" I showed above, here's how to do it.
1. Create a report variable called rnGrandTotal, set the expression to the SOMENUMBER field, set the Calculate option to SUM, and set the RESET point to End of Report.
2. Create another report variable called rnPriorTotal, set the expression to 0, set the calculate option to SUM, and set the RESET point to End of Report. (By itself, this would yield zero at the end of the report .. but I'm not done yet so don't get worried yet)
3. In the On Exit Expression of the Group Footer band, put the following expression:
_VFP.SetVar('rnPriorTotal', rnGrandTotal)
4. Use rnPriorTotal in the Group Footer band to show the prior total.