

In NAV 2009 reports are rendered in Report Viewer 2008 this works like a charm, but in Report Viewer 2010 the SSRS team has been so kind to us to change the logic of how a reports is rendered. So hold that thought, it has to be hidden and at the top for Code.GetData to work. The textbox is hidden and needs to be first thing that activated when the report is rendered. With this textbox we now store all the fields from the body as one long string, which we can then access from other textboxes in the header. Now we need to get the fields to the header, so our dear report 206 developer has added a textbox to set data in the header. So we have now identified the where all the fields which we need in the header.That is a lot fields in one single textbox, good thing it is hidden and only use to get the values from current scope in the report dataset. The report developer probably thought adding 4 groups did not really simply things, so now we have all 54 fields added to one single textbox. Notice that there is only 1 textbox, in NAV 2009 we had 4 textboxes. As I always I like to visualize things so if we look at the header and the top of the body of report 206 it looks like the below picture: To understand how Code.GetData and Code.SetData works there are 4 areas we need to look at. Understanding Code.GetData and Code.SetData
#Mibuso getdata find how to#
If you already know how this works you can skip this section and go directly to the “Redesigning report 206.”, where I show you how to get rid of Code.GetData and Code.SetData in report 206. “Code.GetData(54,1)” in my eyes is not.įor the people not familiar with Code.GetData and Code.SetData in RDLC reports I will do a small introduction now. I will show you how you simple can change this so the report becomes human readable, because i.e. And they way it is designed it needs to use Code.GetData and Code.SetData. So here we are, NAV 2013 have just been released and standard report 206 is still using Code.GetData and Code.SetData, just like it did in NAV 2009.

Here is a screenshot of the header in standard report 206 in just released NAV 2013:Īs you can see a lot of > all over and not really human readable, and it gets worse when opening one of these expression, because the values are just Code.GetData and a number.Īnd here is a screenshot of the header after my changes which I explained in details in this post:Īs you can see now all fields are visible and if you need to make modification it easy to locate where your changes need to take place. Looking at the before and after images should give you an idea what this post is all about. This blog post is pretty long so I would like to show you the header in Report 206 before and after my changes.

Actually when I realized that this was possible in RDLC 2008, I was actually crying, because this limitation in RDLC 2005, used NAV 2009, has been a huge pain, at least for me.īut in I this example which I’m about to show you, I will not use this new capability in RDLC 2008. Yes we can now add fields directly into the header in RDLC 2008, used in NAV 2013. Just adding the field in the header will not keep this synchronization, unfortunately. Code.GetData and Code.SetData is used in the header to of the report to keep field values in sync with current sales order currently being printed in the body. The goal with this post is to show how NOT to use Code.GetData and Code.SetData in the one of the most common used Document report in NAV, our beloved 206 report.
