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

Subreport Visibility

edited April 2005 in General
I am having some trouble getting a subreport to be visible or invisible
based on whether or not another subreport traverses some data. Here are
the nasty, nested details:

Report: Main
(Declare boolVar)
SR I
(Detail - BeforeGenerate: boolVar := FALSE)
SR A
SR B
SR C
SR 1
SR 2
(Detail - AfterGenerate: boolVar :=
TRUE, nested in two if statements)
SR D
SR E (no data pipeline)
(On Print: SR E.Visible := boolVar)
SR F (no data pipeline)

[The order of the subreports here is reflected in the object outline,
and hence (I assume) the Z-Order]

The report preview "hangs" when the "next page" button is pushed (at
least the first page will show up, sometimes more -- this seems unreliable).

If something doesn't make sense just let me know... but if it does...
what am I doing wrong?

Thanks for the help.

Comments

  • edited April 2005
    Stanley P wrote:
    Oh, and one additional piece of information: if boolVar is defined
    (either way) immediately before the SR E.Visible assigniment the preview
    does not hang (so its a definition issue, but I can't figure out why).

    Thanks Again,
    SP
  • edited April 2005
    Stanley P wrote:
    Just in case anyone thought I was done... each of the SubReports in SR I
    shifts relative to the one immediately prior to it (for instance SR D
    shifts relative to SR C.)

    SP
  • edited April 2005
    > Just in case anyone thought I was done... each of the SubReports in SR I

    1) Support has told me in a private email that when you set a TppSubReport
    visible, items that shift relative to it should be set to the item before
    it, so in this case:

    ppSubReport1
    ppSubReport2
    ppSubReport3

    if they are shift relative to each other, and ppSubReport.Visible is set to
    false, then the ShiftRelativeTo property of ppSubReport3 needs to be set to
    1.

    That said, I've set Visible propertie so TppSubReports and TppRegions quite
    a bit and never had a problem.

    2) I don't see anything wrong with what you've said you've attempted. You
    may try setting the report to two pass and see if you have issues.

    3) The way I've done this is to extent RAP via pass-through function and
    determine the record count of a pipeline (but I wasn't using DADE--you might
    be, but may still be able to do it that way as well, just more work).

    Ed Dressel
    Team DM
  • edited April 2005
    Stanley P wrote:

    I have stumbled on another problem, most likely related... it looks like
    the boolVar that I referred to earlier is resetting to FALSE each time a
    new page is generated (it is in the BeforeGenerate event). One detail
    band often spans multiple pages, so this is a problem. Where to I reset
    boolVar to false to make sure that this only happens once per detail
    band, prior to generation specifically (I know I can just do a sync with
    Count, but there is surely a more straightforward way).

    Thanks Again.
This discussion has been closed.