Hello Martin,
1. Your formula is very good. For similar sample reports, I use a formula that calculates the period. For example, I have a formula named Col:
(Year(Print Date)-Year(Date))*12 + Month(Print Date)-Month(Date)
The detail formulas for each column reference this Col. For example, for Last month, the formula is:
if Formula:Col = 1 then Amount else 0
2. My formula for the Date Heading is also complicated but rolls nicely through Year End. I format it to limit the printout to Month and Year. This is my formula for Last Month:
if (Month(Print Date)>1) then Date(Year(Print Date),Month(Print Date)-1,1) else
Date(Year(Print Date)-1,Month(Print Date)+12-1,1)
3. Yes, you can have more than one range in your selection formula. For example, you could use Runtime Value (from Special Data) to set a Date range and an Item range. For example:
Date <= Runtime Value and Item <= Runtime Value
4. Yes, you can suppress fields from printing and no, you cannot suppress lines. You can create formulas so that the values in the subtotal on print if the subtotal is greater than 0. Unfortunately, QRDOS does not have the feature to suppress blank lines. This feature is in QRW.
Happy New Year!