Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

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

  • VDM Profile Picture
    VDM 2 on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Kindly share the report object also me

    at my email:-vivekmatharoo00@gmail.com

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: SetData() and GetData() on NAV Reporting Layout

    Hey Franz,

    I would like to print one report always two times. I have seen your explanation. Unclear is for me how I fill the Value...where does the layout get my value for example 2?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: SetData() and GetData() on NAV Reporting Layout

    GetData and SetData reduces the performance of the reports and increases the complexity. Only use them when you create a report with headers in forms (sales order, quote, etc).

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

    I've  been tinkering with Reports for quite a while now aswell and i would not recomment using getData and SetData as for some of the reasons that have been already pointed out above aswell as the simple fact that the report Data breaks when using a certain character. Its most unlikely that anyone ever would use "±" in any sort of adress or name but if so all of the data in getData and SetData won't show in its proper position. This behavior is caused by the way microsoft decided to create these function which are btw also horrible in performance.

    This is how SetData works: 

    Saves values in text arrays split by the ± character, the "group" parameter just helps microsoft organizing the arrays.

    So basically your Adress Data would look like this: Name±Address±Address2±......

    GetData splits those values again. 

    And you will probably understand my concern now. Try it out, use ± in a customers name or address.

    The best way to avoid this is to either

    - create your own getData and SetData functions or

    - use the Reports VB codearea to save and set the data right from the dataItems in the report

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: SetData() and GetData() on NAV Reporting Layout

    It Worked for me. However you can also watch the YouTube video on the link below

    www.youtube.com/watch

  • Suggested answer
    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

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

  • Verified answer
    keoma Profile Picture
    keoma 32,675 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.

  • Verified answer
    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. 

  • keoma Profile Picture
    keoma 32,675 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.

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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans