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

Can a SubReport be turned off

edited December 2006 in General
The report has three sub-reports that are connected via
DataPipeline's to their respective tables. All works fine when
the three tables are present.

However, the occasion arises that under some circumstances one or
two of the tables may not be present. Is there a way to disable
the sub-reports and the data aware components? Current I get the
cannot open dataset error.

Many thanks....

Comments

  • edited December 2006

    Try setting subreport.Band to nil, that will remove the subreport from the
    report.

    When the main report engine initializes, it finds all of the datapipelines
    used in the report and initializes/opens all of them.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2006
    Nard -

    With my initial testing, the report just hangs.

    From a prior message where Nico helped another user, he
    suggested the following to solve a slightly different problem. I
    have done that, so could it interfere?

    <<<
    Be sure the NoDataBehaviors property of your report and subreport
    is set to ndBlankReport rather than ndBlankPage. This will allow
    non-data aware components to show up even if there is no data
    available.

    Also be sure you have the SkipWhenNoRecords property of the
    Detail Pipeline set to False.

  • edited December 2006

    - Try calling Subreport.Free instead. I just tested and that seemed to work.

    - NoDataBehaviors controls what happens when the dataset is empty.
    SkipWhenNoRecords is used to determine what happens whether a master record
    with no corresponding detail is included in the report. Both of these are
    documented in the ReportBuilder online help.

    In the original post, you said that the tables may not be present, but
    perhaps you meant the tables are preset but empty.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2006
    Nard -

    That is a winner!! Yes, the table(s) are absent when the reports
    are run.

    Many, many thanks...

    Todd

  • edited December 2006
    You may try setting the sub Report .visible property to false--I use this in
    a different context and it works well.


    Ed Dressel
    Team DM
This discussion has been closed.