Best solution for report?

MrCul1
Member Posts: 8
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?
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
-
I think want you want to do would best be solved by using an array for the total amounts. What you will have to do is use a date array aswell using code as used in report 120.
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 helps0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions