Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Data from Lines to be displayed in Report Header

(0) ShareShare
ReportReport
Posted on by 3,027

Hi

    In Invoice Lines i have Field XYZ . In a document it can have same no in all lines or it can be different in some lines . I want to save Unique values in array and then display in Report Header.

Thanks

*This post is locked for comments

  • Verified answer
    Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Data from Lines to be displayed in Report Header

    Hi,

    You can code in this way.

    matchfound:=false; //matchfound is a boolean variable

    newValue := /*assign the new value which comes*/.

    FOR i := 1 TO n DO BEGIN

     IF newValue = array[i] THEN

       matchfound:=true

     ELSE

     matchfound:=false;

     if matchfound=false then

     /*assign the new value to the array*/

    END;

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Data from Lines to be displayed in Report Header

    Hi

     Can u pls help with 1 example

    Thanks

  • Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Data from Lines to be displayed in Report Header

    Hi,

    In order to find unique values you can run a loop in OnAfterGetRecord which runs every time a new value comes up, and compares if this new value is equal to the previously stored values in the array.

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Data from Lines to be displayed in Report Header

    Hi

      It can be Like this ID/B/123 , ID/D/4678 , ID/B/123 , ID/Z/A/123. In above scenarion i want value to be in variable i s

    ID/B/123 , ID/D/4678 ,  ID/Z/A/123

    Thanks

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Data from Lines to be displayed in Report Header

    Hi

       It can be Like this ID/B/123 , ID/D/4678 , ID/B/123 , ID/Z/A/123. In above scenarion i want value to be in variable i s

    ID/B/123 , ID/D/4678 ,  ID/Z/A/123

    Thanks

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,749 on at
    RE: Data from Lines to be displayed in Report Header

    What kind of value it is ? You can use STRPOS function to check if that value exists.

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Data from Lines to be displayed in Report Header

    Hi

      How i will check only unique values are stored.

    Thanks

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,749 on at
    RE: Data from Lines to be displayed in Report Header

    Get those values based on the lines in the OnAfterGetRecord of the Header DataItem and then store that value in a text variable with a separator instead of array because if you use array you need to set every dimension as datasource and it could vary based on the lines.

  • ManishS Profile Picture
    ManishS 78 on at
    RE: Data from Lines to be displayed in Report Header

    Why do you want to store it in array ?

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans