How to print TransHeader and TransFooter in Microsoft Dynamics NAV RDLC reports

We know that TransHeader and TransFooter section types were available in NAV 2009 version but there are no such section types in RDLC, even though wecan achieve these in RDLC report using report functions.

We can print TransHeader and TransFooter in RDLC report using below functions:

     1.  Using RunningValue function.

     2.  Using ReportItems function.

RunningValue Function: It uses a specified function to return a running aggregate of the specified expression. It returns current summed up value for the page if we are summing value of a field, for example.

RunningValue function syntax:  RunningValue(Expression, Function, Scope);


     1.  Expression: Expression contain fields on which to perform the aggregation.

     2.  Function:  Aggregate function, sum, count, average, min, max, to apply to the expression.

     3.  Scope: Name of a grouping that contains the report items to which to apply the aggregate function. The running value is reset for each new group.

ReportItems Function: This function can be used to refer value of a text box from other text box.

ReportItems function syntax: ReportItems!;

A sales document where we need to print “Continued” caption and “Balance or Amount” in current page footer and the same in next page header as if sales entries continued to two or more pages for a group, for instance.

Here I explain how to do this. We can use RunningValue function to aggregate values of a field and refer the field value from text boxes from page header and footer to get TransHeader and TransFooter values for the current page.

Step by step:

a.  Add a textbox on the detail section of a row in table control. We are here summing up values of a field based on a group hence we must place a text box in details section row, the text box where we add RunningValue function to aggregate values, shown in below screenshot.

Shows text box added in Details row of the table control.

Screenshot 1: Shows text box added in Details row of the table control.

 b.  Write RunningValue function in the text box expression window.

 i.  You can also select the RunningValue function from common function list available in the expression window as shown below.

Shows how to select RunningValue function in expression window.

Screenshot 2: Shows how to select RunningValue function in expression window.

ii.   Fill up parameters in the function as I explain below, such as

1.  First parameter (expression): The field which want to sum up. I have selected “Amount” field in “Sales Line” table, for example, as shown below.

2.  Second parameter (Aggregate function): Choose the aggregate function, Sum, Count, Avg, Min, Max, etc. I have chosen “Sum” to sum up sales lines amount, for example, as shown below.

3.  Group (Scope): Choose name of the group to which to apply aggregate function, “No_SalesHeader”, for example. Here I’m grouping sales lines amount based on sales document number, as shown below.

Shows RunningValue function parameters and Group.

Screenshot 3: Shows RunningValue function parameters and Group.

Save the expression and rename the text box as “TransFooterSum”.

c.   Add two text boxes in Page Footer to shows “Continued…..” caption and “Balance or Amount” of the current page.

Shows Page Footer Text Boxes.

Screenshot 4: Shows Page Footer Text Boxes.

d.   Add caption “Continued…..” caption in first text box and for second text box refer the last summed up value from the text box “TransFooterSum”, where Aggregate function has been written to sum up the “Amount” from sales lines.

i.   Write text “Continued…..” in the expression window for first text box and click OK to save and close the text box.

ii.   Use the function “ReportItems! to refer value of the text box, In second text box, as shown below.

iii.  Get last value of the text box, because we need last summed up entry (value) for the current page, it shows summed up value for entries onto the page, in second text box. Here the RunningValue function returns summed up value for each page based on the group to which field value refers to, as shown below.

  Shows how to refer last summed up value from “TransFooterSum” text

Screenshot 5: Shows how to refer last summed up value from “TransFooterSum” text box.

e.   We should hide TransFooter as we print final sum or total in the last page. We can hide these text boxes using built in functions related to page numbers such as Globals!PageNumber and Globals!TotalPages.

Write below expression in visibility window of text boxes to hide in the last page:



1.   Expression (First Parameter): Function hides the value if expression evaluates to true. Here we want to hide text boxes if we are on the last page. It compares whether current page is equals to last page (total pages).

2.   Hide if true (Second Paramter): Hides if expression evaluates to true.

3.   Show if true (Third Parameter): Shows if expression evaluates to true.

Hence we hide text boxes if current page reaches last page while printing report.

f.    We can use the same functions, fields and steps to achieve TransHeader sum with different values such as:

i.   To get TransHeader sum we need to refer to first summed up value on the page. As I explained above, if we get the first summed up value which includes the previous page sum with current page first entry. As we are fetching the first entry, it has been summed up with the previous page, hence we must subtract the first entry on the pager to get previous page sum, to show the last summed up value of the last page in the current page TransHeader.

    “=RunningValue(Fields!Amount_SalesLine.Value,Sum,"No_SalesHeader") - Fields!Amount_SalesLine.Value”

ii.   After this we refer this value from a text box in the Page Header. Hence we must refer the first value of the function on the page.


Report printed screenshots shown below:

Shows first page (No Transheader)

       Screenshot 5: Shows first page (No Transheader)

Shows second page (Both TransHeader and TransFooter)

      Screenshot 6: Shows second page (Both TransHeader and TransFooter)

Shows last page (No TransFooter).

       Screenshot 7: Shows last page (No TransFooter).

If you wish to discuss regarding this RDLC Report Design blog, please feel free to drop me an email to dileepa.b@ecanarys.com.


How to print Header and Details (Lines) in different pages of a RDLC Report in NAV 2013 R2

We usually print header and details section of a document on same page, what if we want to print on ...

Read More >

How to Customize the Microsoft Dynamics NAV 2013 R2 Splash screen Image

I think I got late with this post, but I was unaware that most of us still don’t know how to c...

Read More >

How to Print Microsoft Dynamics NAV 2013 R2 RDLC Report Page Footer on Last Page Only

As we are all know there were two properties in NAV 2009 to print footer at bottom and on last page ...

Read More >

New and Important things to know for better RDLC report design in NAV 2013 R2.

We are all learning new things about RDLC report design and we know that still there are lot of thin...

Read More >

Design Microsoft Dynamics Navision 2013R2 RDLC Report Part-2

 In this post we will move to next step, and there we will go through two more data item groupi...

Read More >

How to write custom code in NAV 2013 R2 Report layout design?

You may want to add custom code to the RDLC report to do more actions than what's already provid...

Read More >

Design Microsoft Dynamics Navision 2013R2 RDLC Report

What is RDLC Report?The Report Definition Language (RDL) Data is a report component that is used by ...

Read More >

Microsoft Dynamics NAV 2013 R2 Chart Generator

In general chart means visual display of information, this is one such feature that is introduced in...

Read More >



please give object this report
10/13/2017 2:58:31 PM | Reply

Post a Comment

Try DevOpSmartBoard Ultimate complete Azure DevOps End-to end reporting tool

Sign Up

  • Recent
  • Popular
  • Tag
  • Key Metrics to Measure DevOps Success

    DevOps words means many things to many people and all the definitions might be partly right. DevOps is all about continuously seeking feedback, understanding challenges, and improving the way the soft...
  • Bulk Export Import Test Cases to Azure DevOps Test Plans using CSV file

    As a user of Azure DevOps Test Plans or TFS Test Management for manual testing, from a long time everyone including me had a wish, that copy of test cases from excel or csv file along with test steps ...
  • Azure DevOps Overview

    Now a days Azure DevOps is very famous with IT and Operations team along with developers, so what is Azure DevOps? It is a Software as a service (SaaS) platform from Microsoft that provides features r...
  • Volume Management in Kubernetes

    Since pods created in k8s are ephemeral, we are able to get the data as long as pods are alive, but if pods are terminated data stored in it completely lost and it cannot get back, for that we need to...
Monthly Archive

Contact Us
  • *
  • *