web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Get Item LOT no on rdlc report

(0) ShareShare
ReportReport
Posted on by 259

I have a purchase order with one line. Lot numbers are attached to item as shown in below screenshot. I want to show these LOT numbers on my rdlc report where I have a table and in this table I have columns for Item no. & Lot no.s for this Item no. If there are multiple Lot no.s against one line, then i need to show all lot numbers in single column(Comma separated).

2388.Annotation-2020_2D00_08_2D00_15-183005.png

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    157 on at

    Don't have your exact requirement mapped out but I've seen something similar so maybe this helps you get closer.

    pastedimage1597654180421v1.png

    At the bottom of a report this type of view was added so it showed all serial or lot references for each item on the order. So not in a line underneath just it's own discreet section. Here is the code if it helps out to try this instead.

    Globals:
    ItemTrackingAppendix Report Item Tracking Appendix (6521)
    TrackingSpecCount Integer
    TrackingSpecBuffer Record 336
    ShowTotal Boolean
    ShowCorrectionLines Boolean
    ShowGroup Boolean
    TotalQty Decimal
    OldRefNo Code[20]
    OldNo Code[20]
    ShowLotSN Boolean

    DataItem ItemTrackingLine as an Integer

    PageLoop - OnPreDataItem()
    // Item Tracking:
    IF ShowLotSN THEN BEGIN
    TrackingSpecCount := 0;
    OldRefNo := 0;
    ShowGroup := FALSE;
    END;

    ItemTrackingLine - OnPreDataItem()
    IF TrackingSpecCount = 0 THEN
    CurrReport.BREAK;
    CurrReport.NEWPAGE;
    SETRANGE(Number,1,TrackingSpecCount);
    TrackingSpecBuffer.SETCURRENTKEY("Source ID","Source Type","Source Subtype","Source Batch Name",
    "Source Prod. Order Line","Source Ref. No.");

    ItemTrackingLine - OnAfterGetRecord()
    IF Number = 1 THEN
    TrackingSpecBuffer.FINDSET
    ELSE
    TrackingSpecBuffer.NEXT;

    IF NOT ShowCorrectionLines AND TrackingSpecBuffer.Correction THEN
    CurrReport.SKIP;
    IF TrackingSpecBuffer.Correction THEN
    TrackingSpecBuffer."Quantity (Base)" := -TrackingSpecBuffer."Quantity (Base)";

    ShowTotal := FALSE;
    IF ItemTrackingAppendix.IsStartNewGroup(TrackingSpecBuffer) THEN
    ShowTotal := TRUE;

    ShowGroup := FALSE;
    IF (TrackingSpecBuffer."Source Ref. No." <> OldRefNo) OR
    (TrackingSpecBuffer."Item No." <> OldNo)
    THEN BEGIN
    OldRefNo := TrackingSpecBuffer."Source Ref. No.";
    OldNo := TrackingSpecBuffer."Item No.";
    TotalQty := 0;
    END ELSE
    ShowGroup := TRUE;
    TotalQty += TrackingSpecBuffer."Quantity (Base)";

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,086 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,290 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,218

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans