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

Community site session details

Session Id :

Change the values of the report header text box dynamically based on the page content.

Arunraj Rajasekar Profile Picture Arunraj Rajasekar 1,743

Sometimes the report header needs to change from page to page. For example, on page one, the vendor ID and description must be displayed, and on page two, the vendor ID and description for a different vendor must be displayed, as shown in the screenshot below.

pastedimage1669220362275v1.png

pastedimage1669220372633v2.png

This is simple to achieve with a table, but header does not support tables. You can only create a textbox in the header.

To accomplish this customization, data must first be organized in the Tablix. The data in the Tablix must be grouped, and a page break must be added at the end of each group.

To set page break to a row group:

  • In the Grouping pane, right-click a row group, and the click Group properties.
  • On the Page Breaks tab, Select Between each instance of a group and Also at the end of a group to specify that a page break be added when group ends in the table.

This will group vendor records related to each vendor ID into their own page.

Add the fields that need to be displayed on the header in a separate row within the group in Tablix, as shown in the screenshot below.

pastedimage1669220402999v3.png

Set row visibility to hide to ensure that this field does not appear when printing the report. Make a note of the field name from the properties. Assume the name of the field is textbox1. Create a text box for the vendor id in the header. Enter =ReportItems!textbox1.value in the text box expression.

Keyword Reportitems returns a list of all the fields in the report. Textbox1.value returns the textbox1's current value.

pastedimage1669220438342v4.png

https://learn.microsoft.com/en-us/sql

Comments

*This post is locked for comments