web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Report section and function

(0) ShareShare
ReportReport
Posted on by

Good morning everybody,

I have started using NAV since a week, I'm stuck in a problem regarding the use of the report fields. In particular, I'm trying to modify an existing report (I have opened it and saved it with a different name and ID) adding for instance some new fields to the dataset. If I have understood well, the way to show a field in the Header section of the report is by exploiting a "hidden textbox" in which I can insert the "setData" method. Well, If I create a new textbox in the header and I modify the "Expression" giving the "=Code.GetData(x,y)" with an existing x, it works properly. But, when I try to insert a new field in the dataset and then I add it into the SetData, when I retrieve it into the textbox I cannot see it, it's not printed out. Unfortunately it's not clear this step, my questions therefore are: which is the correct method to print a general field created into the dataset into the header? What if I create a report without header/body section? Will I be able to avoid the SetData/GetData methods simply dragging and dropping the dataset filed into the report paper?

Thanks in advance and have a nice day

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    In Headers and Footers in RDL Layout we cannot just add fields from the dataset. Instead, we must add the field to the Body of the report (but hide it), and then use the ReportItems! collection in the header to refer to the field in the Body.

    More info here:

    https://docs.microsoft.com/en-us/sql/reporting-services/report-design/built-in-collections-reportitems-collection-references-report-builder

  • Suggested answer
    Suresh Kulla Profile Picture
    50,245 Super User 2025 Season 2 on at

    Yes if you don't want the field on the header and footer, you can just drag that field from the Report --> Data to the textbox but if you need that on the header then you need add that to the SetData Textbox and based on which location and group you have added you need to specify that in the GetData function.

  • Bodhi Profile Picture
    558 on at

    Please see the following content in Microsoft Dynamics NAV 2016/2017 developer or IT pro

    How to: Print Report Header Information on Multiple Pages

  • Bodhi Profile Picture
    558 on at

    In the header of the report.rdlc file, create one or more text boxes to save the data from the hidden text box in the body section. For example, in report 206, a blank text box is in the header section. It has the following expression as the value of its Hidden property:

    =Code.SetData(ReportItems!CustAddr.Value,1)

    The first parameter in the SetData function call corresponds to the name of the text box in the body section. The second parameter corresponds to the group number.

  • Community Member Profile Picture
    on at

    I have tried to do all the stuff suggested below, unfortunately I cannot show the element yet. In particular I'm referring to the "BilltoCustNo_SalesShipHdr" field in report 208. Since there's one field in the body BUT there's no reference into the SetData function, I've decided to add it manually. Then I've opened the hidden textbox -> Visibility -> F(x) -> and I've added Cstr(Fields!BilltoCustNo_SalesShipHdr.Value) and all the Chr(177) needed. Then I went to the header, created a textbox and as Expression I've set "=Code.GetData(numberOfField,1)" and obviously substituting "number_of_field" with the correct value, in my case 45. If I run the report it doesn't work, but if I change number (let's say 44 or 25 or whatever) it shows the correct parameter!!!!  I don't know what to think about.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans