Notifications
Announcements
No record found.
Hello Everyone,
For the past month, I've been working on the Inventory Availability Plan report and the Planning Worksheet in Business Central. The Inventory Availability Plan report currently has a fixed number of interval columns, but I need to make them dynamic.
For example, I want to display data in 1-week intervals over a 3-month period, meaning the number of columns should adjust accordingly.
Is there a way to achieve this in an RDLC layout?
report 69000 "Inventory Availability Plan" { DefaultLayout = RDLC; RDLCLayout = './InventoryAvailabilityPlan.rdlc'; dataset { dataitem(Item; Item) { column(No; "No.") { } column(Description; Description) { } dataitem("Dynamic Periods"; Integer) { DataItemTableView = SORTING(Number) WHERE(Number = CONST(1)); column(PeriodStartDate; TempPeriodBuffer.StartDate) { } column(PeriodQty; TempPeriodBuffer.Quantity) { } trigger OnPreDataItem() begin TempPeriodBuffer.Reset(); TempPeriodBuffer.SetRange("Record No.", Item."No."); SetRange(Number, 1, TempPeriodBuffer.Count()); end; trigger OnAfterGetRecord() begin if TempPeriodBuffer.Get(Item."No.", Number) then; end; } trigger OnAfterGetRecord() var StartDate: Date; EndDate: Date; Interval: DateFormula; i: Integer; begin // Define the period range and interval StartDate := WorkDate(); // Or any user-defined start date EndDate := CalcDate('<3M>', StartDate); // 3 months Evaluate(Interval, '<1W>'); // 1-week intervals // Populate temporary buffer with dynamic periods TempPeriodBuffer.Reset(); TempPeriodBuffer.DeleteAll(); i := 1; while StartDate <= EndDate do begin TempPeriodBuffer.Init(); TempPeriodBuffer."Record No." := "No."; TempPeriodBuffer."Period No." := i; TempPeriodBuffer.StartDate := StartDate; TempPeriodBuffer.Quantity := CalculateInventoryQty("No.", StartDate); // Your logic here TempPeriodBuffer.Insert(); StartDate := CalcDate(Interval, StartDate); i += 1; end; end; } } requestpage { layout { area(content) { field("Start Date"; StartDate) { ApplicationArea = All; } field("Period Length"; PeriodLength) { ApplicationArea = All; Caption = 'Period Length (e.g., 1W, 1M)'; } field("Duration"; Duration) { ApplicationArea = All; Caption = 'Duration (e.g., 3M, 6M)'; } } } } var TempPeriodBuffer: Record "Period Buffer" temporary; StartDate: Date; PeriodLength: Text; Duration: Text; local procedure CalculateInventoryQty(ItemNo: Code[20]; PeriodStart: Date): Decimal var ItemLedgerEntry: Record "Item Ledger Entry"; begin // Example logic: Calculate inventory qty for the period ItemLedgerEntry.SetRange("Item No.", ItemNo); ItemLedgerEntry.SetRange("Posting Date", PeriodStart, CalcDate('<1W>', PeriodStart)); ItemLedgerEntry.CalcSums(Quantity); exit(ItemLedgerEntry.Quantity); end; } table 69002 "Period Buffer" { TableType = Temporary; fields { field(1; "Record No."; Code[20]) { } field(2; "Period No."; Integer) { } field(3; StartDate; Date) { } field(4; Quantity; Decimal) { } } }
Interesting question! I know everyone loves the convenience of Excel for Inventory Availability Planning or the Planning Worksheet. In your case, I would suggest using import/export with Excel or a paginated report in Power BI.
To answer your question, yes, it can be done in an RDLC layout.
Valentin Castravet Work: Zander ERP Services Blog: Dynamics 365 Business Central Insights LinkedIn: www.linkedin.com/in/valentin-c-0500a247/
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.
OussamaSabbouh 3,151
Jainam M. Kothari 1,443 Super User 2025 Season 2
YUN ZHU 1,092 Super User 2025 Season 2