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

How to set visibility of subreports based upon detail band count

edited August 2005 in RAP
What would be the best way to turn the visibility of subreports on or off if
we are basing our visibility decision upon the detail band count within each
of the subreports.

Reason for doing so is to print supplemental pages IF the subreport is too
big to print on the master page.

Example would be:

If Subreport 1 had over 15 lines to print, turn the subreport.visible to
false and turn the supplemental page subreport visibility to true.

Thanks ahead of time.
Bill Brittain

Comments

  • edited August 2005
    I would create a RAP pass through function that returns the record count of
    a pipeline... actually I have one:

    TetdPipelineRecordCount = class(TraSystemFunction)
    public
    class function Category: string; override;
    procedure ExecuteFunction(aParams: TraParamList); override;
    class function GetSignature: string; override;
    class function IsFunction: boolean; override;
    end;

    { TetdPipelineRecordCount }

    procedure TetdPipelineRecordCount.ExecuteFunction(aParams: TraParamList);
    var
    lPipeline: TppCustomDataPipeline;
    lCount: integer;
    begin
    GetParamValue(0, lPipeline);
    if (lPipeline is TppDBPipeline) and
    assigned(TppDBPipeline(lPipeline).DataSource) and
    assigned(TppDBPipeline(lPipeline).DataSource.Dataset) then
    lCount := TppDBPipeline(lPipeline).DataSource.Dataset.RecordCount
    else
    if (lPipeline is TppJITPipeline) then
    lCount := TppJITPipeline(lPipeline).RecordCount
    else
    lCount := 0;

    SetParamValue(1, lCount);
    end;

    class function TetdPipelineRecordCount.GetSignature: string;
    begin
    result := 'function GetDBPipelineRecordCount(aDBPipeline:
    TppCustomDataPipeline): integer;';
    end;

    class function TetdPipelineRecordCount.IsFunction: boolean;
    begin
    result := True
    end;



    --
    Ed Dressel
    Team DM
  • edited August 2005
    Thank you Ed.

    I will try it tonight.

    Bill Brittain


  • edited August 2005
    Thank you Ed.

    Worked just perfectly. Would have never been able to figure that one out
    for myself.

    Thanks again for the function. Very much appreciated.

    Bill Brittain





This discussion has been closed.