Report-Group By Order No. from Sales Shipment Line
liizz
Member Posts: 125
Hi all,
I am on a report whereby I need to group Order No. from Sales Shipment Line and make a sum of 'Quantity'. My report is based on Sales Shipment Header and Sales Shipment Line.
Lets' say for this e.g:
Order No. Quantity
101001 2
101001 3
101001 1
101001 2
101001 2
101001 2 Then, sum=12.
I do not want to make use of GroupTotalFields because there are more customizations which are required.
I have placed the Qty field on the Footer of Sales Shipment Line.
Sales Shipment Line, Footer (9) - OnPreSection()
SalesShptLine.RESET;
SalesShptLine.SETRANGE(SalesShptLine."Order No.","Sales Shipment Line"."Order No.");
SalesShptLine.SETFILTER(SalesShptLine.Quantity,'>%1',0);
IF SalesShptLine.FINDSET THEN BEGIN
REPEAT
Qty:=Qty+SalesShptLine.Quantity;
UNTIL SalesShptLine.NEXT=0;
END;
SalesShptLine:record variable and Qty:decimal variable.
The Qty calculation is being displayed accordingly but it is being shown three times for this mentioned Order No. as mentioned above. There should not be grouping on Document No.
Please help me.
Thanks
Liizz
I am on a report whereby I need to group Order No. from Sales Shipment Line and make a sum of 'Quantity'. My report is based on Sales Shipment Header and Sales Shipment Line.
Lets' say for this e.g:
Order No. Quantity
101001 2
101001 3
101001 1
101001 2
101001 2
101001 2 Then, sum=12.
I do not want to make use of GroupTotalFields because there are more customizations which are required.
I have placed the Qty field on the Footer of Sales Shipment Line.
Sales Shipment Line, Footer (9) - OnPreSection()
SalesShptLine.RESET;
SalesShptLine.SETRANGE(SalesShptLine."Order No.","Sales Shipment Line"."Order No.");
SalesShptLine.SETFILTER(SalesShptLine.Quantity,'>%1',0);
IF SalesShptLine.FINDSET THEN BEGIN
REPEAT
Qty:=Qty+SalesShptLine.Quantity;
UNTIL SalesShptLine.NEXT=0;
END;
SalesShptLine:record variable and Qty:decimal variable.
The Qty calculation is being displayed accordingly but it is being shown three times for this mentioned Order No. as mentioned above. There should not be grouping on Document No.
Please help me.
Thanks
Liizz
0
Comments
-
What other data items are on your report? Do you have other Group Totals on the report?Gerry Kistler
KCP Consultores0 -
I think you should use Integer as a Data Item and set this Property Maxiteration =1 then call your code into Integer Footer section.
Hope this will help you.
0 -
Sales Shipment Line, Footer (9) - OnPreSection()
if PrevOrderNo := "Sales Shipment Line"."Order No." then begin
Qty := 0;
CurrReport.Skip;
end;
SalesShptLine.RESET;
SalesShptLine.Setcurrentkey("Order No.");
SalesShptLine.SETRANGE(SalesShptLine."Order No.","Sales Shipment Line"."Order No.");
SalesShptLine.SETFILTER(SalesShptLine.Quantity,'>%1',0);
IF SalesShptLine.FINDSET THEN BEGIN
REPEAT
Qty:=Qty+SalesShptLine.Quantity;
PrevOrderNo := "Sales Shipment Line"."Order No.";
UNTIL SalesShptLine.NEXT=0;
END;,0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions