If you want do show data from the dataset in header, or footer, you need to refer to a reportitem (textbox) you can't directly refer to the dataset field.
SetData, GetData is used to simplify this, so you don't need to mess around with 20-30 hidden textboxes to display header/footer data. You just need at least one textbox, there you have your data separated by a delimiter (char 177) with setdata you bind that data to a global variable. Once this this data is bound to that variable, you nolonger relay on the textbox being available on the current page (for example if you have 3 tables for different sections of your report, like in sales invoice, you can't refer your headers data to a textbox directly because that textox will never be available on all pages, because you have 3 different tables and the textbox can only bi in one of them).
Therefore you need to the setdata asign the data to this global variable so its available on all pages.
GetData obviously gets that separated data back to display it.
I hope this was understandable, because i found it hard to explain, actually.
Comments
http://dynamicsuser.net/blogs/alexchow/archive/2010/07/06/how-to-define-setdata-and-getdata-in-rtc-reports-in-dynamics-nav-navision.aspx
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
SetData, GetData is used to simplify this, so you don't need to mess around with 20-30 hidden textboxes to display header/footer data. You just need at least one textbox, there you have your data separated by a delimiter (char 177) with setdata you bind that data to a global variable. Once this this data is bound to that variable, you nolonger relay on the textbox being available on the current page (for example if you have 3 tables for different sections of your report, like in sales invoice, you can't refer your headers data to a textbox directly because that textox will never be available on all pages, because you have 3 different tables and the textbox can only bi in one of them).
Therefore you need to the setdata asign the data to this global variable so its available on all pages.
GetData obviously gets that separated data back to display it.
I hope this was understandable, because i found it hard to explain, actually.
BTW: The same applies to SetPicture / GetPicture