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

Sub report on a group footer band

edited September 2002 in Subreports
Hi, I am hoping for a help...

I tring to create a report which will produce the following result.
1. Print an detail list of SKU list of each order in Orders table (same SKU
can have different order details). There are two grouping for this report;
Orders and Category. Also the dataset for the datasource is a Query, not a
table, because I need to combine two tables to get a Orders result.

2. At the end or each order, summarize the SKU by printing the each SKU and
it's quanity sold.

I wrote report 1. already and I have to add 2.

First, I added a sub-report on the footer of the Order grouping since I need
to iterate SKU to print on the sub-report, and it needs to be printed after
the OrderDetails have been printed for that order. I also added a new DB
Pipeline for the sub report, hooked up the new Query and datasource for it.
The sub-report pipleline is set to the new DBPipeline.

The query for the sub-report is "Select SKU, sum(QTY) from OrderDetails
where OrderID = :OrderID GROUP by SKU". I am using the AfterGenerated of
the first report's detail band to set the OrderID of the new query.

When I run the report, I get an exception indicating that ReportBuilder
cannot open the dataset.

Anyone know how to get around the expection or am I going about creating the
sub-report the wrong way?

Any help or hints are greatly appreciated.

Thanks,


SeHun Kim
Gateway Ticketing Systems, Inc.
shkim@gatewayticketing.com
www.gatewayticketing.com

Comments

  • edited September 2002
    Aside from the error, which is probably related to the DataSource property
    of the detail query not being assigned - linked queries are going to run
    slow, perhaps very slow.

    Though they require the detail Query to be ordered carefully (i.e. detail
    ORDER BY must be all master ORDER BY fields + all detail ORDER BY fields)
    and the MasterFieldLinks to be created carefully (one link for each ORDER BY
    field in the detail), linked data pipelines can be very fast. I've attached
    an example which uses linked data pipelines to generate a report very
    similar to the one you describe - it's slightly more complex, with 'SKU'
    summaries after each group and at the end of the report...

    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
  • edited September 2002
    Thanks Tom.

    Yes, the problem was incorrect property settings on Datasource and
    sub-report DBPipeline. And, yes. The report seems to run slow.

    Thanks and thank you for the example, though I can not view all the
    properties. We are using RB 4 for Delphi 5.

  • edited September 2002
    RB 4? Yikes. Then my suggestion ain't so great. You need RB 6.03 to use
    MasterDataPipeline/MasterFieldLinks and the speed increase is usually worth
    it...

    At a minimum turn CachePages on so you only have to traverse the data
    once...

    --
    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
  • edited September 2002
    Tom,

    Is there a way to do that in RB4? Our QA flagged the report being too slow.
    :~(

    Thanks,

    SeHun
  • edited September 2002
    We have released RB 7 for Delphi 5, 6 and 7, which is now the latest
    version. You'll have to upgrade to RB 7 in order to use these properties
    with the technique Tom spoke of. Contact info@digital-metaphors.com with
    your registration information in order to upgrade, or visit our website
    order page www.digital-metaphors.com


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.