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

Partial GroupNo

edited January 2004 in General
Hi all.

I have a report with 3 groups.

I would break the second group counting the number of section for each
macro group.
I.E. :

------- A------------ 1ST LEVEL

---------- 1a----------- 2ST LEVEL
---------- 2a -----------
---------- 3a -----------
---------- 4a -----------
---------- 5a -----------
---------- 6a -----------

------- B------------ 1ST LEVEL

---------- 1b-----------2ST LEVEL
---------- 2b -----------
---------- 3b -----------
---------- 4b -----------

------- C------------ 1ST LEVEL

---------- 1c-----------2ST LEVEL
---------- 2c -----------
---------- 3c -----------
---------- 4c -----------
---------- 5c -----------
---------- 7c -----------
---------- 8c -----------
---------- 9c -----------
---------- 10c -----------
---------- 11c -----------

I would count the number of 2nd level item at the footer of the 1st
level group; how many 2nd level item for each 1st level group.
The GroupNo variable increments its value on every group so, at the last
footer I have the total group number, not the partial one.

Where is the mistake ? What is the correct use of the groupno variable?

Thanks in advance.

Regards.

Mario

Comments

  • edited January 2004
    Hi Mario,

    If you have not done so already, try placing a TppDBCalc component in the
    1st level group footer with its calculation set to Count(*) and set to reset
    on group A break. This should give you an accurate count of how many
    records are being traversed per group. If your report is more complicated
    that this, for example if you are using subreports, you may need to use
    TppVariables and calculate the count using the OnCalc event.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2004

    Hi Nico.

    Thanks for your answer.

    The situation is a little more complicated than I been able to explain:
    I think my example is not so clever, so your answer doesn't solve my
    problem.

    Then, the right situation is:

    ------- A------------ 1ST LEVEL
    ---------- 1a----------- 2ST LEVEL
    -------------1a1
    Single record level
    -------------1a2
    Single record level
    -------------1a3
    Single record level
    -------------1a4
    Single record level
    -------------1a5
    Single record level
    ---------- 2a ----------- 2ST LEVEL
    -------------2a1
    Single record level
    -------------2a2
    Single record level
    ---------- 3a ----------- 2ST LEVEL
    -------------3a1
    Single record level
    -------------3a2
    Single record level
    -------------3a3
    Single record level
    -------------3a4
    Single record level
    -------------3a5
    Single record level
    ---------- 4a ----------- 2ST LEVEL
    -------------4a1
    Single record level

    ---------- 5a ----------- 2ST LEVEL
    -------------5a1
    Single record level
    -------------5a2
    Single record level
    -------------5a3
    Single record level
    -------------5a4
    Single record level
    ---------- 6a ----------- 2ST LEVEL

    ------- B------------ 1ST LEVEL

    ---------- 1b-----------2ST LEVEL
    -------------1b1
    Single record level
    -------------1b2
    Single record level
    -------------1b3
    Single record level
    -------------1b4
    Single record level
    -------------1b5
    Single record level
    .
    .
    .
    .
    .
    .
    .
    .

    As you can see, the 2nd level is a group level and a count DBCalc give me
    back a "record" count; what I need is a "group" count of the 2nd level. I.E.
    how many 2nd level group break are in the 1st level.

    Thanks more

    mario




  • edited January 2004
    Hi Mario,

    I see, so you are trying to count the amount of 2nd level group breaks in
    the footer of each 1st level group. It looks like initially you are on the
    right track by creating a global variable GroupNo and incrementing it in the
    AfterGroupBreak event of the second group. Then you will need to reset the
    value of the GroupNo variable, perhaps in the Group1FooterBand.AfterPrint
    event. This way you will only get the partial group total in the footer of
    each 1st level group.

    --
    Best Regards,

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