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

Data traversal bug

edited March 2002 in General
D5, RB6.03. Long story.

I had a master-detail-detail report with 3 queries properly tied together.
I could never get it to work properly, so I took out the last subreport and
I traversed the last query in code in the remaining detailband.beforeprint.
(When I traversed the last query, all I did was add some text to a memo in
the detailband.) It then sometimes printed and previewed an infinite number
of page ones. I fixed it by taking out the last query's.datasource
property, and by just opening it by setting the ParamByNames in the
detailband.beforeprint. This is just another case of an infinite loop that
I think you should address.

Also, I noticed that when I previewed this report on two different machines,
one showed 28 detail lines, and the other had 29. It was the exact same exe
and data. Why could this happen?

Thanks,
George

Comments

  • edited March 2002
    Did the queries return the proper data outside of RB? Connect the 3 queries
    up to 3 TDBGrids on a form. Do they show the detail records as you click on
    them?

    The report should print the records that are provided in the dataset of each
    data pipeline. Be aware, the Detailband.BeforePrint event may fire more
    than once. This can happen if a dynamic height detail band begins generating
    for one page, but needs to support KeepTogether on one of its components.
    It will print on the next page and refire the BeforePrint event. I'd
    imagine that the middle master/detail datapipeline is moving to the next
    record, when the page breaks. Because the datasets aren't linked, then the
    datapipeline moves to the next record, regardless if there are subreports
    which need to print after it. I would try getting the master-detail-detail
    datasets working correctly on some dbGrids first, to see the data in the
    order that you want. Then connect it up to the report to make sure that you
    get the same records.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.