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

How to run the same report/subreport against multiple datasets?

edited April 2004 in General
Is there a way to run the same report or subreport against multiple datasets
as part of the same run?

As a simple example, I have a mailing label that I want to run against three
different datasets as part of the same report run. Is there a way to chain
these datasets together into a single report with each dataset being
traversed after the last has finished? (And not restart a page as I want the
labels to continue from the next available.)

Thanks,
Robert Gesswein

Comments

  • edited April 2004
    Hi Robert,

    Each report/subreport in ReportBuilder is designed to traverse the data of
    one dataset. Try placing a Child style SubReport in the detail band for
    each dataset you have. Then connect each subreport to each separate
    dataset. Now you are essentially creating X number of reports in one with
    the capability of traversing X number of datasets.

    Note: Be sure to set the ShiftRelativeTo property of each subreport under
    the first one so they do not overlap eachother when printing.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2004
    Thanks for the quick reply Nick,

    I ran across this same method in a couple of the demos (51 & 52 I think)
    yesterday. It does work for simple cases and I ran my label example this way
    just fine. The problem is with more complex reports. The report I'm
    undertaking now is a two column report with two nested subreports and dozens
    of controls, shapes, and lines. Many of the controls have event handlers and
    the lines are positioned at run time. Using the subreport method means I
    have to create lots of unique names, duplicate event handlers, and lots of
    extra redundant code. It also means that when I make a change to one
    subreport I have to make the same change in many other places.

    I think I'll try JIT pipelines to the various datasets along with fake
    grouping data. Then I can set the pipeline record count to the total number
    of all records from all the datasets and return the appropriate data through
    the pipeline. More difficult up-front work but easier report changes I
    suspect.

    --Robert

  • edited April 2004
    Hi Robert,

    Sorry, I did not realize you were developing a much more complicated report.
    The use of JITPipelines as you said below would definitely be your best bet
    to get exactly what you want out of this report. Good luck and let me know
    if you have any other questions along the way.

    --
    Best Regards,

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