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

RecordCount and RecNo of a TppDataPipeline

edited March 2008 in RAP
Are you able to retrieve the current recno and recordcount of a subreport's
datapipeline as it traverses detail lines?

Thanks

Alex

Comments

  • edited March 2008
    Hi Alex,

    The RecordNo property of the DataPipeline is currently not available in RAP.
    The datapipeline traverses the data from start to finish, it does not have a
    concept of a record count before it has begun. What exactly would you like
    to accomplish? Perhaps there is another way to solve this problem.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2011
    Hello,

    looks as if that's what I wanted to know either...

    I have a "column" in my report (i.e. caption in the groupheader + the
    value-field on the detailband). I need to set both to visible for *all*
    records of the detailband-pipeline, if there are at least two different
    values in the said field. If all records have the same value in that field
    (either all empty or all of the same value), then that "column" shouldn't be
    visible for *all* records.

    1. I've tried to use a variable within the detail band, but somehow I can't
    get it to work for all cases.

    2. Then I wanted to use a global procedure with a for-loop to determine, if
    there are different values (at some point before the generation of the
    detailband), so that I can only set the fields to visible or invisible in
    OnCalc of the detailband-variable according to the value determined in that
    global procedure.

    Would that work or should I stick to my first attempt and try to find the
    reason for it not working always?

    Regards,
    Mark

  • edited October 2011
    Hi Mark,

    If I understand correctly, you would like to hide everything if all
    field values are the same and display everything if at least two field
    values are different?

    I would need to know more information about your first attempt to see
    what exactly is happening. I assume you are checking the value of the
    field during the first pass of the report and toggling visibility based
    on those values.

    If your second attempt at this is successful, I suggest using it :).

    Best Regards,

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


    Yes, that's correct :)


    Correct, that's how I was doing it, but it wasn't working in the case, if
    all positions had the value 0 (or empty) but the last one, because I was
    checking, if the number of changes (glDiscountValueCount) is > 1 (initial
    change of the value to compare hat to happen once). But in the case above it
    wasn't working.

    I tried a bit more now and do the initial change with the help of the tag
    property, so that it doesn't get counted as a real change.

    if Report.FirstPass then begin
    Label24.visible := false;
    DBText20.visible := false;

    if Variable3.Tag = 0 then begin
    Variable3.Value := Positions['DiscountPercent'];
    Variable3.Tag := 1;
    end
    else if Variable3.Tag = 1 then begin
    if Positions['DiscountPercent'] <> Variable3.Value then begin
    Variable3.Value := Positions['DiscountPercent'];
    glDiscountValueCount := glDiscountValueCount + 1;
    end;
    end;
    end
    else begin
    if glDiscountValueCount > 0 then begin
    Label24.visible := true;
    DBText20.visible := true;
    end;
    end;

    This seems to work now, unless you see some issues, which I might have
    missed so far :)

    Thanks,
    Mark
  • edited October 2011
    Small addition:

    Variable3.Tag is being reset to 0 in ReportBeforePrint


This discussion has been closed.