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

Where is the proper place to load data for subreports?

edited February 2013 in General
We recently updated from an older version of Delphi & RB 8, to Delphi
XE2 and Report BUilder 14.07 build 326.

I'm seeing an issue with some of our subreports where I know there's
data, I can see it coming back to the clientdataset on a data request,
but it's not being displayed.

For some of the records in the main dataset (cdsMain), the subreport
will correctly show the child dataset (cdsChild) data. For some it only
shows partial data, and in others it shows none.

The basic design of the reports is that as the cdsMain scrolls from 1
record to another we load the data for the cdsChild. We disable
controls of the dataset so that any datachange events or code won't
impact the performance or cause any side effects, so in the report
print I've been trying to come up with the correct place to do the
child table datarequest.

To prove out the issue, I created a new demo app that didn't have
anything else on it, so I could rule out any legacy code causing the
issue. I've made the demo as simple as possible and I can still see the
problem occur.

I tried putting the cdsChild.datarequest on the report detailband
BeforePrint but that didn't work. Neither did putting it on the main
pipeline OnTraversal or DataChange events.

If needed I could share the demo form & the data example (as XML or a
Clientdataset) if that helps explain this issue more clearly.

I'm sure there is a way to load the child data that will work
correctly, I just can't seem to find it.

Any help you can offer would be greatly appreciated as we have ~400+
reports that we can't trust the results of right now.

Thank you,
Rich


--
---
Rich Werning
TIP Technologies, Inc.

Comments

  • edited February 2013
    Hi Rich,

    Are you certain each subreport is connected to the proper dataset?
    ReportBuilder will traverse the data it is given so if there are no
    detail records for a given master, nothing will print.

    Please send the simple demo to support@digital-metaphors.com in .zip
    format and I'll take a look at it for you.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2013
    Nico Cizik (Digital Metaphors) wrote:


    Email sent .. dang, that was fast. Nice support!

    --
    ---
    Rich Werning
    TIP Technologies, Inc.
  • edited February 2013
    Nico Cizik (Digital Metaphors) wrote:


    Well isn't that a kick in the head.. I was walking through the issue
    with another developer showing her the demo, and I think I found the
    problem. Seems that some of the child pipelines have the RangeBegin set
    to rbCurrentRecord not rbFirstRecord.

    I poured over these reports several times trying to find the problem -
    not sure how I missed that setting. They shouldn't be set to current
    record, but they are. After correcting it, the data seems to be loading
    fine now.

    Sorry for the trouble,
    Rich

    --
    ---
    Rich Werning
    TIP Technologies, Inc.
  • edited February 2013
    Excellent! Glad you got it sorted.

    Best Regards,

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