Access Text box value in (Report Builder and SSRS) using ReportItems
Today I am going to share little bit important lesson. But I will hope you have already know this. Most of the times you might be required to access another text box value in Dynamics NAV report layout. For instance, Some times, developers want to show total on the top of the report, Like Total Invoice Value. Also in the body you have calculated the line wise value and you have the total with you. But you cannot show it at the beginning. Now you might be seeking a solution.
You may wondering there is a in built function called ReportItems. Simple and straightforward. The ReportItems includes text boxes that are in the current scope of a page header, footer, or body. This will identify at run time by the report processor/report render.
You may find good example in Microsoft (MSDN) website. So same example I will show here.
This expression, placed in a text box, displays the value of a ReportItem text box named
Textbox1
:=ReportItems!Textbox1.Value
- This expression, placed in a ReportItem text box Color property, displays the text in black when the value is > 0; otherwise, the value is displayed in red:
=IIF(Me.Value > 0,"Black","Red")
This expression, placed in a text box in the page header or page footer, displays the first value per page of the rendered report, for a text box named
LastName
:=First(ReportItems("LastName").Value)
Simply use ReportItems then use the textbox value.