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

Groups and Subreports

edited April 2003 in Subreports
I'm trying to implement what I think should be a fairly straightforward
billing report, but I'm having some trouble with it.

The data for the report comes from a single query. Each row contains (among
others) an AccountNumber and BillingType column. The data returned from the
query is ordered by AccountNumber + BillingType.

For each account I need the following:

- A list of non-call transactions (e.g. BillingType <> 'CALL'). This is to
be in a specific format. For example:

Header: Non-Call Transactions

Date Time Description Amount
----- ----- ----------- --------

- Followed by a list of call-only transactions (e.g. BillingType = 'CALL')
with a *different* format. For example:

Header: Call Transactions for XYZ

Date Time Description Rate Minutes Amount
----- ----- ----------- ----- -------- ---------

I have 2 groups, one for AccountNumber and one for BillingType. The problem
is that, while I can have a different header for the two groups of
BillingTypes, I can't create a different *detail line* for each one.

I've tried using subreports to achieve this functionality, but even if I put
the group break for the BillingType on the subreport, it still won't allow
me to achieve a different detail line for the next break.

Any help would be greatly appreciated.

Thanks,
Doug

Comments

  • edited April 2003
    Double the height of the detail band temporarily. Now, create two regions
    the size as the original detail band. One region is going to contain the
    first group's controls. The second region should hold the second group's
    controls. The region needs to parent the controls, so drag the controls into
    each region. Move the region to test to see if the controls drag along with
    it to test the parenting, much like a TPanel on a form behaves. Now you can
    move the regions on top of each other and shrink the detail band height to
    its original size. Then toggle the visibility of the regions so you can show
    the first region in the forst group and the second region in the second
    group. Use the DetailBand.BeforePrint event to set the regions visibility.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    Jim,

    Thanks a bunch, that did the trick.

    One more question: I've set the regions to be transparent, but they are
    still printing behind each of the detail lines. Is there something else I
    need to set?

    I'm using D5 + RB Enterprise Version 6.03.

    Thanks,
    Doug

  • edited April 2003
    Right click over the component and try calling SendToBack from teh popup
    menu so that a control is behind the others in the band in the Z-order.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    That didn't work. I even set Transparent to True for all of the regions in
    the DetailBand.BeforePrint. I also closed and restarted the application
    (this is using the end user report designer BTW).

    Thanks,
    Doug


  • edited May 2003
    Unfortunately, most printers don't handle transparency very well. Try
    updating your printer driver and also test on another printer. If it works
    on another printer, then it is a problem with the implementation of how the
    Win API calls we make are handled by the printer driver. If you can't get it
    to work, feel free to send a simple exampel to support@digital-metaphors.com
    and we'll print the report on our printers here to see how it prints.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.