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

Data traversed twice

edited May 2003 in Subreports
Hi,

Please bear with me as I tried to explain the problemthe best way I can.
I have a report which consists of 1 main and 3 sub-reports. Each one has
its own data pipeline. Each of the sub report has multiple groups and I
need to calculate subtotals on each group. One of the group is grouped
by the type (a 2 char string) of the transactions. Besides displaying
the subtotal I need to display the type too. So I have a TppVariable to
calculate the subtotal and that works fine, and a TDBText to display the
type. An example of the subreport will be somthing like this


JE transactions
...
JE subtotal: $######
PC transactions
...
PC subtotal: $######
......

Somehow if the second type (PC in the above example) has just enough
transactions to finish the page but the subtotal band has to be printed
on the next page, it seems the transactions for the JE type get
traversed again, and instead of printing 'PC subtotal' it will say 'JE
subtotal' again but with the correct subtotal for PC transactions. If
the one or more of the PC transactions spill over to the next page along
with the subtotal label then everything seems to be fine. It will
display the correct subtotal label and subtotal amount. I have set the
variable's timing to datapineline traverse and reset at group end
(selecting the corresponding pipeline and group). What am I missing
here? If you need more info please let me know. Thanks.

Bill

Comments

  • edited May 2003
    Are you using BR 7.02? What database are you using? What data connectivity
    are you using? Do you have any event handlers that are manipulating or
    traversing the data? How do you have your data access configured? If you are
    using master detail linking? Make sure you do not set the
    Datapipeline.MasterDataPipeline and MasterFieldLinks if you are using
    standard Delphi linking or parameterized queries.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    I'm using RB 5.54 (I know it's very old). We're using Interbase. The report is
    used to list transactions by vendors, and need to display totals by type of
    transaction and by vendor. Each subreport represents a different category of
    transactions, and each category has different types. Each pipeline uses a
    TIBQuery to fetch the report data. The main report's query gets a list of
    vendors, and each subreport datapipleline is linked to the main datapipeline
    through MasterDataPipeline and MasterFieldLinks (vendor name). On each of the
    subreports, it's grouped by type of transaction, and in the group footer band
    there is a subtotal variable to sum by type of transaction, and each variable
    has a OnCalc event which simply adds the amount of the transaction to the
    subtotal. There is also a DBText to display the type of the transaction, and it
    has no events. The report is set to one pass, and the timing on the subtotal
    variable is set to Calculate On DataPipelineTraversal and the Data Pipeline is
    set to the pipeline for the subreport, the Reset On is set to Group End, and the
    Group is set to the group. No Master detail linking between the queries, the
    only linking is through Datapipeline.MasterDataPipeline and MasterFieldLinks.

    Thanks for your time.

    Bill

  • edited May 2003
    Can you create an example using the Employee.gdb Interbase demo that
    reproduces the problem and send it to support@digital-metaphors.com That way
    we will be able to debug the problem using data values we are accustomed to
    and can more easily solve the problem.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    Ok, I will try to come up with the example. The only thing is that it only
    happens when in the specific situation as I described. I don't know if any other
    data can produce the same result but I will try. But I will try.

    I have another issue with the same report but I don't know if this is the right
    group. The report has the feature of previewing in Acrobat 4 (we use
    TExtraDevices), so I previewed it for all vendors and it generated about 40
    pages in Acrobat which is correct, then I close the Acobat and ran the report
    for just one vendor, and when the Acrobat opens it says there is error opening
    the document because there is no page. I looked at the recordcount of the
    queires and they all have data. This seems to me a TExtraDevices error.

    Bill

  • edited May 2003
    I did some more test and it seems like it only happened to vendors that don't have
    data in all the subreport queries. What I mean is when all vendors are ran, all
    three subreport queries have data in them. Then if I ran for a single vendor that
    only has data in one of the queries and not the other two (recordcount = 0) then the
    error comes up, but if I ran for a vendor that has data for all three queries then
    there is no error. Also, if I ran the same vendor that gave me the error the second
    time there is no error either. It seems to me that the data pipelines might be
    messed up somewhere between when there was data and when there was no data? I did
    pipeline.Close; ibquery.close; ...; ibquery.open; pipeline.open; in the code for
    each time I run the report. Is there something I can set to the pipeline or the
    subreport to fix this problem? Thanks.

  • edited May 2003
    Try testing with RB 7.02 instead of using RB 5.54. The datapipeline
    architecture is a pass through to the TDataset interface on your data access
    component. Perhaps a bookmark is out of sync on the dataset. We would need
    you to build an example using RB 7.02 that shows the problem. Send it to
    support@digital-metaphors.com

    Also, for your ExtraDevices question, use our Devices newsgroup or contant
    James Waler directly.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.