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

Community site session details

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

How to add a dataitem to Report Extension?

(1) ShareShare
ReportReport
Posted on by

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
    Nitin Verma Profile Picture
    on at
    RE: How to add a dataitem to Report Extension?

    Hi,

    Please refer the below link

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

  • Suggested answer
    tanya07 Profile Picture
    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
    Arjun Anand Profile Picture
    on at
    RE: How to add a dataitem to Report Extension?

    Please check the below screenshots:

    pastedimage1654187148117v1.png

    pastedimage1654187188556v2.png

  • jdrco Profile Picture
    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
    tanya07 Profile Picture
    on at
    RE: How to add a dataitem to Report Extension?

    Please check the below -

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

  • Suggested answer
    tanya07 Profile Picture
    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

  • jdrco Profile Picture
    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")

                   {

                   }

               }

           }

  • jdrco Profile Picture
    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

  • Suggested answer
    YUN ZHU Profile Picture
    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

  • Suggested answer
    Community member Profile Picture
    on at
    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans