Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

NAV 2009 Report Sorting Question

Posted on by 234

Hi All

I have a question on report sorting.

I linked two tables Posted P/R Counting Header and Posted P/R Counting Lines with DataItemLink Doc. No. and No.

I just pulled Doc. No, Item No. and Qty on the body section in the Section View.

result is the report sorted by Doc No.

I want to sort by Item No and Group by Item No.

I add secondary key Item No. in the Posted P/R Counting Lines table. and selected sorted by Item No in property of data item

the result is still same, sorted by Doc No.

Can help me how to sort by Item No in this case?

Thanks

 

 

*This post is locked for comments

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: NAV 2009 Report Sorting Question

    Did you try by moving fields into Header Body section in your case?

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: NAV 2009 Report Sorting Question

    No need to take Header as 2nd Dataitem.

    You need to create header as Global Variable and Write code in OnAfterGetRecord trigger of lIne and use the same in Body Section.

  • kcchan Profile Picture
    kcchan 234 on at
    RE: NAV 2009 Report Sorting Question

    Thanks for your reply,

    If I put Lines in 1st DataItem and Header in 2nd DataItem and used LinkReference with Doc. No. and No.,

    I can sort by Item No under Lines Property Sorting

    But don't know why in the body section of Lines, if I put the Header.Doc Date there

    there has a adnormal case. the correct data of Header.Doc Date will start on the second line.

    e.g.

    1st line   Item No    Qty     (Empty of Header Doc Date)

    2nd        Item No     Qty     Header.Doc Date

    .....

    Do you know why has this suitation? Can solve ?

    Thanks

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: NAV 2009 Report Sorting Question

    Yes, you need to put Lines on First Dataitem.

    In OnAfterGetRecord Trigger of Lines, try

    CountHeader.GET(CountLine.DocNo,CountLines.No); //I guess your Header Primary key is Doc No and No.

    If not you need to use Setrange/setfilter.

  • kcchan Profile Picture
    kcchan 234 on at
    RE: NAV 2009 Report Sorting Question

    Yes, I put Header as 1st dataitem and Lines is sub dataitem and linked with Doc. No. and No.

    You mean I need to put Lines in 1st dataitem?

    can you give me some coding example how to get the record?

    use setfilter and setrange?

    thanks again

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: NAV 2009 Report Sorting Question

    Do you have Posted P/R Counting Header  as first dataitem?

    You need to take Posted P/R Counting Line as first dataitem and add Posted P/R Counting Header  as global variable and get the record using coding and then add in sections.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans