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 :
Microsoft Dynamics NAV (Archived)
Answered

SetData() and GetData() on NAV Reporting Layout

(0) ShareShare
ReportReport
Posted on by 5,596

Hi All,

I have been developing RDLC reports for some time now, and the most amazing feature I have come across recently is SetData() and GetData() functions.

I have written a blog article based on the difficulties I have faced, and finally how I performed in a workable way. But, I wanted to ask the community about pros/cons other than mine using SetData() and GetData() functions.

Blog post: https://goo.gl/5hLOqW

Excited to hear from you all!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Nice article.

    Pro/Cons... if you are writing a report for documents like invoice, shipping document, orders, and so on.. you have no alternatives to use Set/GetData functions, it's the only way.

  • Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Hi Federico,

    Thank you for the reply.

    Just one question,

    How does GetData() and SetData() helps on a report's performance?

    Thanks.

  • Verified answer
    keoma Profile Picture
    32,729 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    simply add the dataitem field No_SalesInvHdr to the report header of report 206, means add a textbox with value expression: =First(Fields!No_SalesInvHdr.Value, "DataSet_Result"). That works, if you print one invoice.

    for printing a couple of invoices: add a textbox to the body section, set property hidden to true, set value/expr. to Fields!No_SalesInvHdr.Value, set name=RepItemSalesInvHeaderNo, add a textbox to the header, set expression to =ReportItems!RepItemSalesInvHeaderNo.Value. so you do not need set/getdata.

    getdata/setdata can be used, but reduces the performance.

  • Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Hi Jonathan,

    This is a valuable tip. I will try out and then write a blog article to correct it. How can I give credits to you?

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Agreed with both the Blog post and the Jonathans idea. GetData/SetData reduces the performance of the report and it makes report more complex than we need. I rarely use the GetData and SetData in a report (unless I don't have any other option).

  • keoma Profile Picture
    32,729 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    crediting: with verifying my answer and mentioning me in your next blog post according that topic. i've tried my solution successfully in sales invoice report and order confirmation printing a range of documents.

  • Verified answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Hi Jonathan,

    I tried your method.

    It kind of worked, but it prints the "Invoice No." on the last page of the report only. But I needed in all pages. 

  • Verified answer
    keoma Profile Picture
    32,729 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    strange, when i tested, it were displayed on every page. do you have a special setting on the page header or the textbox control to display the content only on the last page. check the hidden properties of the header, the textbox (button advanced).

    a trick is needed to get the DocNo value on every page in the body section. a textbox control displays the value only on the first or last page, depending of it's position in the report layout. in case of the standard reports there is always a sales/purchase line table. the row header lines are displayed on every page. there normally you have a at least a second row header line, mostly empty, maybe a grapical line is displayed over that row. if there is none, create one below the first row header line, which contains the coilumn captions. show advanced properties, select the second line in the row groups, set property RepeatOnNewPage to true, if it is set to false. this tablix row is (now) displayed on every page. so on every page the content of DocNo is loaded and it can be displayed in the header area.

    use in this tablix header row the first cell as textbox with name RepItemDocNo. set properties as i wrote above. that should work.

  • dave_sat Profile Picture
    5 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Hi Jonathan

    I also want to achieve "printing a couple of invoices" without setdata/getdata but since my English is poor I can't fully understand your explanation.

    Would you kindly share the report object so I can study it ?

    My email is assistan11_at_yahoo_dot_com.

    Thanks in advance

  • Suggested answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Hi Dave,

    I have emailed you the object and other needed guide.

    Also check this post of me which explains in detail: medium.com/.../setdata-getdata-round-2-0-cc3af7d1a9df

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans