Search code examples
visual-studiocrystal-reports

Crystal Reports Put Text in Page Header or Footer based on page content


I have a Crystal Report with several detail sections that all span multiple pages. The number of pages each section spans changes based on data from a database. However, the number of details sections and their titles are constant.

I would like to print in the page header or page footer a text that depends on which detail section is printed on that specific page.

Let's for example say, I have four detail sections. In the page header, I want to print "A", "B", "C" or "D" depending on which detail sections is printed on the page.

The detail sections each contain a subreport, so the actual report doesn't have any data connection.


Solution

  • when I had to do this, I created a formula named pageHeader in each subreport, set to something like:

    whilereadingrecords
    formula = {vw_rpt_prog_proc_rate_date_pivot.programID} & " Program "
    

    and grouped on that formula value, then in that group's options, checked 'repeat group header on each page'

    hth

    -Beth