Array Total

johnpaul.bolo
Member Posts: 6
Hi,
Need help, i want to generate a report from Item and Sales Line table that will show the following:
From Item Body (Total the Sales Line per Item,Customer,Dimension):
Wherein:
Thanks In Advance. [-(
JPB
Need help, i want to generate a report from Item and Sales Line table that will show the following:
From Item Body (Total the Sales Line per Item,Customer,Dimension):
Code Proj. Rsv. RMKS Retail Rsv. RMKS (PROJECT) (RETAIL) ItemA 20 AA001, 10 AA002 5 BB001, 20 BB002 ItemB 5 AA001, 20 AA002....********************************************************
Wherein:
ItemA 10 AA001, 10 AA001,4 AA002, 6 AA002 2 BB001, 3 BB001, 20 BB002 ItemB 5 AA001, 10 AA002, 10 AA002...I use this code:
Item - OnAfterGetRecord() sline.SETFILTER("No.",Item."No."); sline.SETFILTER(sline."Shortcut Dimension 1 Code",'PROJECT'); IF sline.FINDSET THEN BEGIN REPEAT IF (sline."Qty. to Ship" <> 0) THEN BEGIN ProRem[1]:=ProRem[1]+FORMAT(sline."Qty. to Ship")+'|'+sline."Sell-to Customer No."+', '; END ELSE BEGIN ProRem[1] := ProRem[1]+''; END; UNTIL sline.NEXT = 0; END; sline.RESET; . .. ...
Thanks In Advance. [-(
JPB
0
Comments
-
since the number of projects is not fixed and can vary so the usual way to print is like this:
ItemA Projects: AA001 20 AA002 10 Total for Projects 30 Retails: BB001 5 BB002 20 Total for retails 25 Total for Item 30 projects and 25 retails ItemB Projects: AA001 5 AA002 20 Total for projects 25 ... Total for all items N projects and M retails
Do you know how many projects retails you will have ?
IF you know let's say the number of projects will not exceed 10 or so then you could print them horizontally across several pages
But in general printing varying number of sums horizontaly is not easily implemented and i'd suggest to export data to Excel instead0 -
Thanks for your reply, correct me if i'm wrong, In your sample layout of the report it seems that i need to use the group total and tatal in sales line. But what i want is to create a total in item section where in the data is from sales line table. And if i export this to excel the array format will still be not in total arrangement per customer, and need to have a code to tatal in the level of item body section.
And regarding of to print them in horizontal i can use STRLEN function to return the length of a string, then manipulate na maximum length of the record that will fit in the screen. and use the SHOWOUTPUT function to print the other record.
MAJOR CONCERN:.....
If there's a way to total the SLine."qty to ship" per customer in the section of ITEM BODY. please let me know.#-o
MAJOR CONCERN:.....
Please share some sample code's... to tatal the Sline qty, or "qty to ship" per customer in item body section in report. Thanks.
JPBEugene wrote:Eugene"]since the number of projects is not fixed and can vary so the usual way to print is like this:ItemA Projects: AA001 20 AA002 10 Total for Projects 30 Retails: BB001 5 BB002 20 Total for retails 25 Total for Item 30 projects and 25 retails ItemB Projects: AA001 5 AA002 20 Total for projects 25 ... Total for all items N projects and M retails
Do you know how many projects retails you will have ?
IF you know let's say the number of projects will not exceed 10 or so then you could print them horizontally across several pages
But in general printing varying number of sums horizontaly is not easily implemented and i'd suggest to export data to Excel instead0 -
If there's a way to total the SLine."qty to ship" per customer in the section of ITEM BODY. please let me know.
If i understand you right, you want printed something like this :
Item No NNNN: QtyForCust1, QtyForCust2, QtyForCust3 ...
Basically in Item dataitem on its AfterGetRecord trigger you have to define local record L_SalesLine variable set a filter on it and loop through it in REPEAT UNTIL L_SalesLine.NEXT= 0 summing your L_SalesLine."qty to ship" field. You will have to use an array of decimals to hold the qty for each customer.
then in Item's body section you can use multipe texboxes with SourceExpr set to array elements0
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