Home Subreports

Moving bands and rap

edited January 2003 in Subreports
Hi,

I have a report in which at runtime I load a sub report from a file.
This works very well. If the sub report happens to have a header
or a footer, I hook then to the main report by setting the Report
property of that bank. That too works right.

If, inside the header or the footer I put Rap code to set something
that is on the header or the footer that piece of code will not work.
For example, if the header has a label and BeforePrint of the header
sets the caption of that label to 'fred', that will not happen.

I fugure that the rap is being compiled when it is read in and when
I just move code to a different band, it is not being recompiled.
Is there some type of refresh that I am missing? Do I need to get
the codemodule and do a compileall?

Thanks,

Joseph Gordon

Comments

  • edited February 2003
    Child subreports don't support headers and footers. If you load a template,
    then the header and footer will be the parent's header and footer bands.

    If you want to move a RAP event handler in code from one band to another,
    then here is an example. Here is the scenario for this example: the RAP
    event handler was defined for the wrong group band when the app was
    distributed for a client. In order to fix it without losing the customer's
    modifications to the template, and without having to redistirbute the exe,
    this demo moves the RAP event handler behind the scenes.This was the only
    option because there was no Calc tab defined at runtime for the end user to
    make the change
    http://www.digital-metaphors.com/tips/MoveGroupHeaderBeforePrint.zip.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.