Notifications
Announcements
No record found.
Hi
I have 1 DataSource Table Item. Two other tables are Global SubContractHeader,Lines.
I want to get sum(orderedquantity) from SubContractHeader.
Thanks
*This post is locked for comments
Hi Jsshivalik,
Similarly to what I suggested to you here: community.dynamics.com/.../242407
Try to a global variable for your TotalQty and add up the Quantities. Add the variable as a field to your dataset under the SubContractHeader data item.
The other option is to create a group in RDLC for the SubContractHeader and use the some function within the scope of the group, so if your group is called "SubContractHeader" then you will total up like this: SUM(Fields!TotalQty.Value, "SubContractHeader").
As I suggested before watch this video from Techdays 2015: Understanding Grouping in RDLC Reports from this you can learn how to create groups how to create totals with the groups you and a lot of other good things!
I have only 1 Data Item i.e Item Table. Others are defined as Global SubType Record.
If you want to display the Quantity per Subcontract Header than you should add it as a dataitem, or you can do a loop on them using an integer data item.
Can u pls help me in detail. Secondly Item will not be linked directly with SubContract Header
Hi,
Could you please share your dataset?
How are you relating Item with SubcontractHeader and Lines, Why the Item was used as the DataItem, if you need the values from subcontractHeader ? What is your report purpose ?
Below is the code OnItemAfterGetRecord . Item Table is the only DataItem. SLine is Global variable of Record SubType . Similarly the other 2 tables.
OQty :=0; SQty := 0; rIle.RESET; rIle.SETCURRENTKEY("Item No.","Posting Date"); rIle.SETRANGE("Item No.","No."); rIle.SETRANGE("Posting Date",0D,Date[1]-1); IF rIle.FINDFIRST THEN REPEAT OQty := OQty + rIle.Quantity; UNTIL rIle NEXT=0; SLine.RESET; SLine.SETCURRENTKEY("Document No.","No."); SLine.SETFILTER(SILine."No.",Item."No."); SLine.SETRANGE("Posting Date",Date[1] , AsDate); IF SLine.FINDFIRST THEN REPEAT IF SLine."Posting Date" = AsDate THEN BEGIN SQty := SQty + SLine.Quantity; END
No_Item AsDate Ordered Qty Sale Qty Opening Qty FG171 02/06/2017 800 400 FG172 02/06/2017 0 0 FG173 02/06/2017 0 0 FG174 02/06/2017 650 200
If we have Item,Sale Order, Lines . I want to get Item Wise Total Ordered Qty & Total Sale.
Hi Marcell
If u can tell me this scenario how it can be done then i think my problem will also be resolved
You can define a variable 'TotalQty'. Now in OnAfterGetRecord() you can Setrange between 'No' of Sales Line record and 'No' field of Item table. So you will get the quantity from the sales line. Go on adding up the quantity for a particular item and save it in the 'TotalQty' variable which you have defined.
I have written the code snippet for your understanding
SalesLine.Reset,
SalesLine.Setrange(No, ItemTable.No);
If SalesLine.Findfirst then repeat
TotalQty:=TotalQty+SalesLine.Quantity;
Until SalesLine.Next=0;
You need to put 'TotalQty' variable under your dataitem which you have defined in the report and display it in the report.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.