Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Control which reports print

edited January 2002 in General
Hello.

I am sure this has been asked before. If someone could point me to an
existing tech-tip or thread it would be appreciated.

I have a report where the main report is just the detail band with no data
pipelines. In the detail, I have multiple child reports. I would like to
control which reports print based on user selection. The problem I am having
is when I set one of the subreports visible to false, I get access
violations when the report runs. What else must I set in reference to a
subreport that should not print.

Thanks

Eric Stewart
ericvstewart@yahoo.com

Comments

  • edited January 2002
    Are these child type subreports (check Subreport.PrintBehavior), which are
    set to ShiftRelativeTo? You may want to configure the ShiftRelativeTo
    references at runtime, based on which subreports are going to be visible.
    That should be all that is needed to turn them on and off. You'l need to use
    the Detailband.BeforePrint event to configure the layout, as the
    BeforeGenerate is too late.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Thanks Jim.

    No. They are all section reports. Not sure why getting the access violation.
    It only happens if I don't print the first report. However, if I print the
    first report at least once, and then try again to not print the first
    report, it works fine. It appears that the gettext event of at least one of
    the labels is being called even when the report is set to not visible.

    Thanks for any info...

    Eric Stewart
    ericvstewart@yahoo.com


  • edited January 2002
    Check the event handler assignments, perhaps they are flip-flopped between
    labels in two subreports?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Thanks Jim...I'll check.

    Eric

This discussion has been closed.