SQLReport has a layout section which can be used as report page header/footer, this report header and footer can contain any static text, image, lines etc. By default the page headers and footers are displayed on the first and last page of a report, this behaviour can be manipulated by the properties like PrintOnFirstPage orPrintOnLastPage of the page which enables it to display header in the first page and footer in last page of a multi page Report.
Some times we want to display some dynamic content like database-driven value to appear in the page header and footer section in the SQLReport, that functionality can be acheived by putting a textbox in the header/footer section and have it refer to a TextBox value which is bound to a dataset field in the Report body section. So the steps can be as follows.
i) Put a Text Box in the Body section in the Report page and bind it with the appropriate dataset field value that is required to be displayed in the header/footer. You can make it hidden field as well so the end user can not see it in the Report.
ii) Put a Text Box in the header/footer section of the Report and write an expression which in turn would refer to the above placed Text Box value.
e.g : Suppose we have a TextBox as txtConsigneeName in the Report body section and we want to display that value in the header, then what we can do is just put another TextBox in the header section and write an expression as
One thing should be noted that we can not write/refer directly to a dataset field from a TextBox in a page Header/Footer.