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

Double-SubReport

edited December 2003 in General
Hi,

just a simple question: Is it possible to have more than one SubReport?

e.g. a report for table "customer" should look consider orders and
payments and look somewhat like this

-Detail Customer
-Sub: All Orders for this Customer...
-Sub: All Payments for this customer...

There's no need to describe "howto" exactly, just the information if
it's possible and maybe a headwort would help a lot. I'm just starting
with a new report that should later on be extended in order to display
these subreports. If I knew this was possible it would make me feel
better while developing version 1.0 ;-)

Kind regards,

Mark

Comments

  • edited December 2003
    Hi Mark,

    Yes it is possibile for a single report to contain two subreports. It is
    also possible to have nested subreports for a Master-Detail-Detail
    relationship. Once you place your subreports inside your report, be sure
    you have them connected to the correct datapipeline by using the Report |
    Data menu option.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2003
    Hi,

    well I couldn't resist testing this feature immediately and though it
    seemed to be easy to realise, there are either some bugs in RB or I do
    not understand the documentation:

    If my detail-tab is linked to the master tab, RB just shows a single
    white page. If I unlink my detail-table setting "MasterSource" to ""
    the report shows in a correct manner (with the detail-report showing
    all existing detail-datasets within each master-dataset, of course - as
    there's no matching filter for the details any more).

    If I set a filter condition on the detail-dataset that results in an
    "empty" dataset (like True=False) it works fine, too - and does not
    show any details.

    I realised that "bug" earlier on: RB shows an empty page, if the report
    contains no data (which confuses several customers as they expect at
    least header and footer with "zero"-values). This strange behaviour
    seems to be similar - at least there are some single master-datasets
    that do not have any details linked to it.

    Is there any way to find out, why there's just drawn an empty page?

    Kind regards,

    Mark
  • edited December 2003
    Hi Mark,

    By default the Report.NoDataBehaviors property is set to show a blank page
    when the report contains no data. Try changing this to ndBlankReport and
    see if it gives you the results you are after. You are probably going to
    want to steer clear of using filters as this will slow your report
    performance greatly.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2004
    Hi Nico,


    ... that's interesting - but what to do if the user doesn't want to
    have all data printed but only data belonging to December 2003? :-(

    Happy new year!

    Mark
  • edited January 2004
    Hi,

    after changing the properties in order to get a blank report I
    discovered the follwing:

    RB only prints datasets that have subsets, like

    CustNo 123: Mark Meyer
    - Order #123
    - Order #456

    If the data looks like

    ---------------------------------------
    CustNo 123: John Doe (no orders)

    CustNo 456: Mark Meyer
    - Order #123
    - Order #456

    CustNo 789: Tom Smith (no orders)
    ---------------------------------------

    only "456" is printed.

    I checked the tables that are linked to the report using datagrids -
    the original data is OK - it's just report builder who's not printing
    customers without orders...

    Can you help?

    Mark
  • edited January 2004
    Nico Cizik (Digital Metaphors) wrote:


    The EXE-File will do? I could extract the file from my Delphi7-project
    but as it uses TurboDB instead of the BDE I'm not shure if it will help?

    Kinf regards,

    Mark
  • edited January 2004
    Hi Mark,

    Instead of using filters to manipulate your output, try using the built-in
    AutoSearch capabilities of ReportBuilder. Using AutoSearch, you could
    either have a user select which year of results he or she would like to view
    or select this yourself in code. For more information on creating
    AutoSearch criteria, please see the ReportBuilder Developer's Guide or the
    examples located in the \RBuilder\Demos\5. AutoSearch\... directory.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2004
    Hi Mark,

    If possible, please send a small example demonstrating this behavior in .zip
    format to support@digital-metaphors.com and I'll take a look at it for you.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2004
    Hi Mark,

    One more thing I just thought of... if you are using datapipelines, be sure
    the TppDataPipeline.SkipWhenNoRecords property is set to False on your
    master pipeline. This is a published property and I believe the default is
    True. If you still have the issue, please zip up the .exe and template file
    (.rtm) so I can see your layout and perhaps recreate something similar using
    the DBDEMOS database.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2004
    That's it!

    Setting SkipWhenNoRecords on the master pipeline did not help. But
    setting it to false for the detail-pipeline worked fine - though I
    still do not understand the documentation (it's quite confusing): It
    says:

    "Setting this property to false will force the DetailBand to print once
    for the empty dataset. All data-aware controls attached to the detail
    DataPipeline will return nulls in this case."

    Therefore RB should print a Sub-Reports Detail for every master detail
    when setting SubPipeline.SkipWhenNoRecords to false - but fortunately
    it does not.

    It's not quite clear which DetailBand is meant here: "DetailBand" could
    be the master "Detail" or the Subreports "Detail". In my case, no
    Sub-DetailBands are printed if there are none (no "zero-bands"). That's
    what I wanted and as it works fine...

    To me it seems like SkipWhenNoRecors=True for a "Sub-Pipeline" makes RB
    Skip the Master(!)-DetailBand!

    Anyway - It works, so thanks a lot!

    Kind regards,

    Mark
  • edited January 2004
    Hi Mike,

    You're right, it is not very clear which detail band will be printed when
    this property is set to False. Fortunately it is the Master-Detail Band or
    main Report's detail band that is printed once and not the subreport's. I
    will update the help file for the next release with a bit more explaination.
    Thanks.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.