report 50007 “Stock At Hand Report”
{
ApplicationArea = All;
UsageCategory = ReportsAndAnalysis;
RDLCLayout = ‘stock.rdl’;
Caption = ‘Stock At Hand Report’;
dataset
{
dataitem(ItemLedgerEntry; "Item Ledger Entry")
{
RequestFilterFields = "Location Code", "Inventory Posting Group","Item No.";
DataItemTableView = where(Open = filter(true)); // Filter only open ledger entries
column(ItemNo; "Item No.") { }
column(LocationCode; "Location Code") { }
column(RemainingQuantity; "Remaining Quantity") { }
column(CurrentQty; CurrentQty) { }
column(Item_Name; "Item Name") { }
column(Inventory_Posting_Group; "Inventory Posting Group") { }
trigger OnAfterGetRecord()
var
ItemLedgerEntrySum: Record "Item Ledger Entry";
begin
// Reset CurrentQty for each record
CurrentQty := 0;
// Set up filters to sum the quantities for the current item
ItemLedgerEntrySum.SetRange("Item No.", "Item No.");
ItemLedgerEntrySum.SetRange("Location Code", "Location Code");
ItemLedgerEntrySum.SetRange("Inventory Posting Group", "Inventory Posting Group");
ItemLedgerEntrySum.SetRange(Open, true); // Ensure it's filtered for open entries
// Summing Remaining Quantity
if ItemLedgerEntrySum.FindSet() then begin
repeat
CurrentQty += ItemLedgerEntrySum."Remaining Quantity";
until ItemLedgerEntrySum.Next() = 0;
end;
end;
}
}
requestpage
{
layout
{
area(Content)
{
group(GroupName)
{
}
}
}
actions
{
area(Processing)
{
}
}
}
var
CurrentQty: Decimal; // Variable for storing the total remaining quantity
}
thats is my code but the rows repeat them selves like no 1 can be the same as 7 same as 89 like that how can i solve this