Hi.
Just wanted to ask, maybe someone have some good way to do it. I have to design a new report where data comes from single table. Sales line for example. I need create some totals on group footer. Only tricky part is, that I need totals for different time periods on the same row.
Example:
(Ahh seems that after posting this all the spaces are gone. The date periods are column headers, marking same period, user can select. Colums are separated with | sign)
01.01.04-31.01.04 | 01.01.04-31.03.04 | 01.06.04-... | etc.
Total: 1000.- | 3000.- | 8000.- | ...
I hope I made myself clear enough. What could be the best (fastest) way for that?
0
Comments
Name Type
PeriodStartDate Date click on properties and set dimensions to 5
PeriodEndDate Date click on properties and set dimensions to 5
LineAmount Decimal click on properties and set dimensions to 5
i integer
on the request form
Start Date PeriodstartDate[1]
in the OnPreReport Section
periodenddate[1] := calcdate('<+CM>',periodstartdate[1]);
for i := 2 to 5 do begin
periodstartdate := calcdate('<+1M>',periodstartdate[i - 1]);
periodenddate := calcdate('<+1M>',periodenddate[i - 1]);
end;
in salesline OnPreDataItem section
currreport.createtotals(lineamount);
in SalesLine OnAfterGetRecord
for i := 1 to 5 do
if (salesheader."posting date" >= periodstartdate) and
(salesheader."posting date" <= periodenddate) then
lineamount := salesline.Amount;
Then on the report sections change your Footer to use Lineamount[1] to lineamount[5]
Hope this helps