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

Unexpected behavior when SuppressRepeatedValues is used

edited March 2013 in General
RB version 11.08

I tracked down a bug in one of our reports, which is caused by an
unexpected behavior when SuppressRepeatedValues is used. I can't call
this a bug in ReportBuilder, more a scenario where we're doing
something not anticipated.

Our report has a single data pipline and we're using the pipeline's
OnTraversal event. In this event' we're calling TppDBPipeline.Skip and
TppDBPipeline.SkipBack to "look ahead", so we can alter how items on
the detail band are printed based on the values of the next row.

When TppDBText.SuppressRepeatedValues is True,
ppCtrls.TppDBText.PageStart checks the pipeline's BOF property, which
currently depends on the dataset's BOF property. Here's the scenario:

- Start report. Open dataset. RecNo = 1 and Bof = True.

- OnTraversal calls TppDBPipeline.Skip and then TppDBPipeline.SKipBack.
RecNo equals 1 again, but Bof = False. Bof will be False unless we
"hit" the beginning of the dataset.

- So we're back on the first record, but DataPipeline.BOF returns
False. TppDBText.StartPage calls DataPipeline.SkipBack, which does not
change the current row but does set the Bof marker. Then
DataPipeline.Skip is called. Now the pipeline is on the second row.

Soon after, NextRecord is called, and the result is the second row is
not printed.

Digital Metaphors may have a suggestion for how we can do our
look-ahead in another event and not cause this problem. I'm more
concerned that we may have similar logic in other reports (we have over
300 reports). So I've changed our ReportBuilder source.

In ppCtrls.TppDBText.PageStart, change
DataPipeline.Skip;
to
if not DataPipeline.Bof then
DataPipeline.Skip;

Any concerns or suggestions?

Thanks

Comments

  • edited March 2013
    Jon Robertson wrote:


    The newest version of our product is using RB11. But we have hundreds
    of customers still on an older version that uses RB7. I quickly
    reviewed the relevant sections of RB7, and I don't think this problem
    exists for RB7.

    In particular, RB7's TppDBText.PageStart does not call SkipBack and
    Skip. I can't find any code in RB7 that calls these methods related to
    SuppressRepeatedValues or the upkeep of PriorValue.

    Jon
  • edited March 2013
    Jon,

    Thanks for the feedback. I researched this and ReportBuilder 14 includes
    modified TppDBText.PageStart logic that performs the check you suggest plus
    another one.

    Going forward hope you will be upgrading to RB 14. For RB 11.08, looks like
    you can use your modified PageStart logic to solve the issue.

    Here is a link to What's New for RB 14. (Use the side menu to see what was
    new for prior releases)

    http://www.digital-metaphors.com/rbWiki/General/What's_New/RB_14


    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.