Skip to main content
Business Central forum
Suggested answer

How to add a dataitem to Report Extension?

editSubscribe (1) ShareShare
ReportReport
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 59,926 Super User 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,523 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,523 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,523 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 20,984 Super User on at
    RE: How to add a dataitem to Report Extension?

    Hi,

    Please refer the below link

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

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,045 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,570 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans