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

Problem with sum amount brought forward

edited July 2009 in General
Hi. I'm using RB 7.03.
I have ha problem with a report where i want to display the sum amount
from previous pages in the page header.

I followed this sample,
http://www.digital-metaphors.com/tips/RunningTotalInHeader.zip

but, if I have a group, when footer group is printed at the end of a
page, "Running Page Total" sums next detail row (printed in next page)
and when footer group is printed the first in next page, the last row in
previous page is not added in "Total of previous Page" (I send sample to
support@digital-metaphors.com)
I this is a problem of timing with OnCalc event, data traversal and
bands generation, but I can't figure out how to solve it.

Any workaround for this? Is necessary to upgrade version?

Thanks.

Comments

  • edited July 2009
    Hi Jose,

    We have made numerous enhancements to the calculation logic since RB 7. In
    my quick testing in RB 11.05 with your example, the running page total is
    identical to the next page's running page total in the header band and the
    calculations were correct.

    I would suggest downloading a trial copy of RB 11.05 and testing your
    example with that to be sure it works correctly on your end.

    --
    Regards,

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

    Best Regards,

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

    I download RB 11.05, as you suggest, and I have the same result.

    If you points to 2nd page, which finish with a group footer, "Running
    Total" is 154,002.40 when it should be 137,214.40 like in 3rd page
    "Total previous page".
    In the other hand, 4th page, which begins with group footer, "Total of
    previous page" is 316,484.95 while it must be 380.60,70 (like "Running
    Total" in 3rd page).

    I'm loosing something?

    Nico Cizik (Digital Metaphors) escribió:
  • edited July 2009
    Hi Jose,

    I retested with your example and got the same (correct) results. I sent a
    PDF to your email address showing the output I get when executing your
    report with 11.05.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2009
    Nico Cizik (Digital Metaphors) escribió:

    Sorry Nico,
    I don't realize that my data are not the same as yours.
    Therefore, my last message where I'm pointing the pages 2,3 and 4 does
    not make sense for you.

    But if you look at PDF you send me, you can see on page 8 "Running
    Total" is 874,819.35, while on page 9 "Total previous page" is 869,823.35.
    And if you look at page 15, "Total previous page" is $1,351,355.50 while
    "Running Total" in page 14 is $1,358,927.50.

    Problem only occurs when group footer coincides with the beginning or
    end of page.

    I tried to control it with page footer afterprint event, but I can't
    solve it.
    Can you help me?

    Thanks a lot.
  • edited July 2009
    Hi Jose,

    It seems this exaple was not intended to be used with Groups.

    Try bypassing the calculation logic and simply save the value calculated in
    the Page Footer Band and display it in the next Page Header band....

    For instance, inside the Variable2.OnGetText, set a field value to the
    running total. Then in the Header Band, place a Label and assign it's value
    to the saved value.

    procedure TForm1.ppVariable2GetText(Sender: TObject; var Text: string);
    begin
    FValue := Text;
    end;

    procedure TForm1.ppLabel4GetText(Sender: TObject; var Text: string);
    begin
    Text := FValue;
    end;

    --
    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.