Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

How to add a dataitem to Report Extension?

Posted on by 479

After using add() to an existing dataitem on my report extension, I've noticed that I can't add another data item after using that command (add()).
How do I add another dataitem to a report extension?

  • Suggested answer
    How to add a dataitem to Report Extension?
    Hi,
     
    1. Create a report extension
    2. Add your/required dataitem under correct Parent (you can use: addafter, addlast, addfirst).
    3. Add columns and logic (under triggers). 
    4. Publish your extension
    5. Create a new layout/copy existing layout.
     
    Watch out for parent dataitem propery UseTemporary=true. If this is the case, add a new similar dataitem and put child there. 

    Hope this helps. 

    RO
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 69,639 Super User 2024 Season 2 on at
    RE: How to add a dataitem to Report Extension?

    Hi, just adding some info from MS.

    pastedimage1654218769548v1.png

    pastedimage1654218775879v2.png

    pastedimage1654218781715v3.png

    pastedimage1654218787649v4.png

    pastedimage1654218793823v5.png

    pastedimage1654218805886v6.png

    pastedimage1654218812952v7.png

    More details: https://yzhums.com/10723/

    Hope this also helps.

    Thanks

    ZHU

  • jdrco Profile Picture
    jdrco 479 on at
    RE: How to add a dataitem to Report Extension?

    When I do this, the fields come up blank when try to render the report

  • jdrco Profile Picture
    jdrco 479 on at
    RE: How to add a dataitem to Report Extension?

    Hi tanya07 , thanks for your active help. What I am trying to do create a report extension for the Customer Statement that:

    - gets the shipping information of the customer from the Sales Invoices or Posted Sales Invoices that is related to the current customer

    - get Sales Invoice Line information from all of the Posted Sales Invoices of the specific customer

    Here is my code for the first bullet so far in the report extension after the add() command:

           addlast(Customer)

           {

               dataitem("Sales Header"; "Sales Header")

               {

                   DataItemTableView = sorting("Document Type", "No.");

                   DataItemLink = "Sell-to Customer No." = field("No.");

                   column(ShipToName; "Ship-to Name")

                   {

                   }

               }

           }

  • Suggested answer
    tanya07 Profile Picture
    tanya07 1,535 on at
    RE: How to add a dataitem to Report Extension?

    Hi,

    In the below example if you see, I have added dataitemlink where in -

    ItemAttributes."No." field is linked to Sales Invoice."No" 

    pastedimage1654189344751v1.png

    For more queries, please share your code.

    Thanks,

    TK

  • Suggested answer
    tanya07 Profile Picture
    tanya07 1,535 on at
    RE: How to add a dataitem to Report Extension?

    Please check the below -

    docs.microsoft.com/.../devenv-dataitemlink-reports-property

  • jdrco Profile Picture
    jdrco 479 on at
    RE: How to add a dataitem to Report Extension?

    Where can I get a more in depth explanation of dataitemlink? Still not sure what that does.

  • Suggested answer
    Arjun Anand Profile Picture
    Arjun Anand 175 on at
    RE: How to add a dataitem to Report Extension?

    Please check the below screenshots:

    pastedimage1654187148117v1.png

    pastedimage1654187188556v2.png

  • Suggested answer
    tanya07 Profile Picture
    tanya07 1,535 on at
    RE: How to add a dataitem to Report Extension?

    Hi, jdrco,

    Please use addafter() to add another dataitem.

    Thanks,

    tanya kharbanda

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,023 Moderator on at
    RE: How to add a dataitem to Report Extension?

    Hi,

    Please refer the below link

    docs.microsoft.com/.../devenv-report-ext-example

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans