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

Custom Report Grouping

edited March 2011 in General


--
Using RB10 I created a custom report with groups set to break at
intervals, but they are not breaking. How do I get them to break?

Comments

  • edited March 2011
    A little more info on this issue. Using RB 10 Enterprise.

    I can get the report to break on a data field, but not on a custom
    field. I have set the group to break on a custom field which is a calc
    variable. The calc variable calculates an aging period based on
    another calc variable which calculates the age.

    The Age Calc variable is calculated as:
    ----------
    Value:=CurrentDate-Bad_Checks['DateEntered'];
    if (Value<0) then Value:=0;
    ----------

    The Period variable calculates after the Age variable and calculates as:
    ----------
    if (Age.Value<=30) then Value:=30
    else if (Age.Value<=60) then Value:=60
    else if (Age.Value<=90) then Value:=90
    else if (Age.Value<=120) then Value:=120
    else Value:=121;
    ----------

    These calc variables are in the detail band and show correctly. The
    report is sorted by DateEntered and all the data appears correct in the
    report preview. The only problem is that the report does not break
    when the period changes. It looks like there is no report group at all
    in the preview.

    What am I doing wrong?
  • edited March 2011
    Hi Heather,

    The issue is timing. The OnGetBreakValue of the group fires before the
    Variable is calculated so as far as the group is concerned, the values
    have not changed. Though we usually do not recommend this, if you must
    use a TppVariable as the group control, you need to place the
    calculation code in an earlier event such as the Band.BeforePrint. Note
    that there is no guarantee that the event code will only fire once per
    traversal so you need to code accordingly.


    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Ok, think I resolved this by putting all the code for both the age and
    the period into the OnGetBreakValue event. I guess the calc variables
    calculate too late within the detail band for the group break?
    --
This discussion has been closed.