Hi,
I have a new report for inventory and sales details. The report details are as follows.
1. The report has the list of filters. (a) variant code (b) Fromdate (c) todate - From request form
2. The report has two data items. (a) Item (b) Item ledger entry - indended to each other with data item links
3. The report should show the list of values.
(i) soldqty - sum(qty) from ILE table where "Entry type" = "sale"
(ii) receivedqty sum(qty) from ILE table where "Entry type" = "purchase"
(iii) beginqty - This should be the sum(qty) from ILE table where "posting date" before the fromdate
Now the issue is with the rdlc. While using the datasetfields from the report and designing using rdlc, the (i),(ii),(iii) values are showing wrong values.
I tried the following possibilities:
Created new layout, 1. with a group footer/group header - Grouping based on "Item No."
2. with a table detail - Grouping based on "Item No."
But, I failed to got the correct outuput.
Pl find my code below:
Item Ledger Entry - OnPreDataItem()
V_BeginQty := 0;
V_Received := 0;
V_Sold := 0;
V_Adj := 0;
V_EndQty := 0;
RefDate := CALCDATE('<-1D>',V_FromDate);
IF Variantcode <> '' THEN
SETFILTER("Variant Code",Variantcode);
Item Ledger Entry - OnAfterGetRecord()
IF ("Posting Date" < RefDate) THEN
V_BeginQty += Quantity;
IF ("Entry Type" = "Entry Type"::Purchase) AND (("Posting Date" >= V_FromDate) AND ("Posting Date" <= V_ToDate)) THEN
V_Received += Quantity;
IF ("Entry Type" = "Entry Type"::Sale) AND (("Posting Date" >= V_FromDate) AND ("Posting Date" <= V_ToDate)) THEN
V_Sold += Quantity;
IF ("Entry Type" = "Entry Type"::"Positive Adjmt.") OR ("Entry Type" = "Entry Type"::"Negative Adjmt.") THEN
IF (("Posting Date" >= V_FromDate) AND ("Posting Date" <= V_ToDate)) THEN
V_Adj += Quantity;
V_EndQty := V_BeginQty + V_Received - V_Sold + V_Adj;
Pl do the needful.
With warm regards,
Thankesh
***Learn to lead***
0
Comments
Instead of
=Field!YourField.Value
write
=Last(Field!YourField.Value)
I have table header, Group footer in my rdlc design. But, the report shows a blank line on the first row unnecessarily.
Thankesh
***Learn to lead***
Have you set any visibility property for that line?
It works as expected... More or Less...
Thankesh
***Learn to lead***
It works as expected... More or Less...