scripting

dannidanni Denmark
edited May 2010 in FastReport .NET
Hi

Scripting and pageheaders:

To show data from my datasource in pagefooters I do the following:

1. create a parameter "paramA" with the desired expression:
2. add a reportobject (textfield) to the pagefooter
3. on databand.beforeprint I set the textfield.text = report.getparametervalue("paramA") as string;


This works fine on pagefooters but on pageheaders data is put into the pageheader from the 2nd page and forward.

It seems that the first pageheader is rendered before the databand. That is probably the best way to go, I just think I must be missing something.

How do I show the data on first page aswell?



Thanks

Comments

  • edited 2:15PM
    Hello,

    If you want to show data from a datasource in page header/footer, and the same datasource is also used in the databand, use data header/data footer bands instead of page header/page footer. Set its "RepeatOnEveryPage" property to true.
  • dannidanni Denmark
    edited May 2010
    The form of the report is something like this:


    1. (data) masterband X (shown on page1)
    2. (data) detail Y (shown on page1)
    3. (data) masterband X (shown on page2)

    When I multible masterbands I cannot use that approach.



    But why does the scripting work on footers when it does not work on headers?
  • edited 2:15PM
    It's because
    wrote:
    the first pageheader is rendered before the databand.
    To render the first pageheader correctly, put the initialization code in the reporttitle band. It is rendered at the report start, just before the pageheader.
  • dannidanni Denmark
    edited 2:15PM
    Thank you. That works :-)

Leave a Comment