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

Grouping on custom field

edited April 2005 in General
Hi,

I need to group data in a report on a custom field. My group has BreakType
set to btCustomField. I tried to use the groups OnGetBreakValue event to
steer the grouping. But i can't figure out how its working. Could someone
explain me in detail or a small example how to use grouping on custom
fields. Changing break values so the group won't break or force a break.

Greetings,
Filip Moons

Comments

  • edited April 2005
    Hi Filip,

    What exactly are you trying to accomplish with your report? Using a custom
    field to break a group involves changing the break value of that group at
    the proper time during report generation in order for the group to break at
    the right time. Perhaps a little more information on what you are trying to
    do will help me give you an idea of what can be doen in RB.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2005
    Hi Nico,

    First off all i might have replied to you personnally, that wasn't my
    intention, sorry about that.
    I need to totalise rows grouped on its key (varchar(8)) value but not on its
    entire value only but also bitwise. At first I added 7 extra fields to the
    dataset, each field consists of a number of chars from its keyvalue starting
    from the left. fi a row with a keyvalue 12345678 has
    1,12,123,1234,12345,123456,1234567 as additional fields. Those fields will
    be used as grouping fields, I created 8 groups on the 1-7 extra fields and
    its keyvalue which gives me a total of 8 groups. It works but the results
    weren't what i was expecting. Mayb if i can figure out the custom field
    grouping, i might get better results while having more control over the
    grouping. I'll try to illustrate the results by example, otherwise it
    wouldn't be clear i think. Hope you can come up with some good ideas.

    Key values:
    1
    12
    120
    125
    13
    137
    2

    Results for a level 3 grouping using 3 groups on a 1-3 length datafield
    Begin grp level 1 > Key value 1
    Begin grp level 2 > Key value 1
    Begin grp level 3 > Key value 1
    Detail row 1
    Total grp level 3 > Key value 1
    Total grp level 2 > Key value 1
    Begin grp level 2 > Key value 12
    Begin grp level 3 > Key value 12
    Detail row 12
    Total grp level 3 > Key value 12
    Begin grp level 3 > Key value 120
    Detail row 120
    Total grp level 3 > Key value 120
    Begin grp level 3 > Key value 125
    Detail row 125
    Total grp level 3 > Key value 125
    Total grp level 2 > Key value 12
    Begin grp level 2 > Key value 13
    Begin grp level 3 > Key value 13
    Detail row 13
    Total grp level 3 > Key value 13
    Begin grp level 3 > Key value 137
    Detail row 137
    Total grp level 3 > Key value 137
    Total grp level 2 > Key value 137
    Total grp level 1 > Key value 137
    Begin grp level 1 > Key value 2
    Begin grp level 2 > Key value 2
    Begin grp level 3 > Key value 2
    Detail row 2
    ...

    Now the the results what i want to achieve
    Begin grp level 1 > Key value 1
    Begin grp level 2 > Key value 12
    Detail row 120
    Detail row 125
    Total grp level 2 > Key value 12
    Begin grp level 2 > Key value 13
    Detail row 137
    Total grp level 2 > Key value 13
    Total grp level 1 > Key value 1

    Greetings,
    Filip Moons

  • edited April 2005
    Hi Filip,

    This is a tough one :). If I were working on this, I would create a field
    for each key value and create my groups based on those values. Perhaps
    using the (FROM x FOR x) commands to separate the key values out.

    Using a custom field may be a little tricky considering how many potential
    groups you may have. As I mentioned before, the hard part is setting the
    break value at the right time during the report generation to get it to work
    correctly. Currently where are you changing the value of the custom field?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2005
    Hi Nico,

    I was using the OnGetBreakValue event on a sample to see how it works. Is
    there a way to get the 'saved' grouping value that the engine is using
    internally for comparing purposes to know if a break occured or is the
    aBreakValue param in the OnGetBreakValue that value? I was thinking about to
    use the OnGetBreakValue event to force/ignore a break comparing the
    aBreakValue with the current pipilines fieldvalue and some additional tests.

    Greetings,
    Filip Moons

  • edited April 2005
    Hi Filip,

    Sorry for the delay in this response. Yes, the aBreakValue should be the
    currently saved grouping value that the engine uses. Checking this inside
    the OnGetBreakValue should work timing wise.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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