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 6:02AM
    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 6:02AM
    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 6:02AM
    Thank you. That works :-)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.