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

No Data Behaviour Problem

edited August 2005 in General
Hello

I have a report where I have deliberatly gone through each pipline and set
the record count to 0

However, when the report runs, instead of seeing a blank page as I was
expecting, I still see my report?

Cheers

Paul

Comments

  • edited August 2005
    Hi Paul,

    Be sure you have your Report.NoDataBehaviors property set to ndBlankPage.
    Where and how are you setting the record count of the pipelines? In my
    testing with ReportBuilder 9.02, attaching an empty dataset to a report with
    this property set, gave me a completely blank page.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2005
    Hi Nico

    We use JIT Pipelines

    The code that we use for storing pipelines is shown at the bottom of this
    message

    Basically we inherit from your JIT pipeline and store pipelines in a list

    To set the record counts, we just go through each pipeline in the list of
    pipelines setting recordcount to 0

    Cheers

    Paul


    unit clsSTCPipeLine;

    interface

    USES Classes,Contnrs, ppDBJIT, ppTypes, ppDB, clsSTCBusinessObject;

    TYPE TPipeLineDataMode=(pdmSingleObject,pdmListBase);

    TYPE TSTCPipeLine=CLASS(TppJITPipeLine)
    PRIVATE
    FData:TSTCBusinessObject;
    PROTECTED
    FUNCTION NewField(CONST strFieldName,strAlias, strName:String;
    CONST nDisplayWidth,nFieldLength:Integer;
    CONST dtDataType:TppDataType):TppField;

    {Adds required fields to pipeline}
    PROCEDURE AddFieldsToPipeLine;VIRTUAL;ABSTRACT;
    FUNCTION GetPipeLineValue(aFieldName:String):Variant;VIRTUAL;ABSTRACT;
    PUBLIC
    PROCEDURE AfterConstruction;OVERRIDE;

    property Data: TSTCBusinessObject read FData;

    CONSTRUCTOR Create(CONST AOwner:TComponent;CONST
    objData:TSTCBusinessObject);

    destructor Destroy; override;

    PROCEDURE UpdateRecordCount;
    END;

    TYPE TPipeLineClass=CLASS OF TSTCPipeLine;

    TYPE TSTCPipeLines=CLASS
    PRIVATE
    FPipeLines:TObjectList;
    function GetCount: integer;
    function GetPipeLine(const nIndex: Integer): TppJITPipeLine;
    PUBLIC
    PROPERTY PipeLines: TObjectList READ FPipeLines WRITE FPipeLines;

    PROPERTY Items[CONST nIndex:Integer]:TppJITPipeLine READ
    GetPipeLine;DEFAULT;

    property Count: integer read GetCount;

    PROCEDURE AfterConstruction;OVERRIDE;

    PROCEDURE Add(CONST objPipeLine:TSTCPipeLine);

    PROCEDURE UpdateRecordCounts;
    PROCEDURE ResetRecordCounts;

    END;

    TYPE TSTCPipeLineClass=CLASS OF TSTCPipeLine;

    implementation

    uses clsSTCListBase, clsSTCDateListBase;

    { TSTCPipeLine }

    FUNCTION TSTCPipeLine.NewField(const strFieldName, strAlias, strName:
    String; const nDisplayWidth, nFieldLength: Integer;
    const dtDataType: TppDataType):TppField;
    VAR
    objField:TppField;
    obj:TppMasterFieldLink;
    BEGIN
    {Create field}
    objField:=TppField.Create(Self);

    {Fill properties}
    objField.FieldName:=strFieldName;
    objField.FieldAlias:=strAlias;
    objField.DisplayWidth:=nDisplayWidth;
    objField.FieldLength:=nFieldLength;
    objField.Name:=strName;
    objField.DataType:=dtDataType;

    {Add field to pipeline}
    AddField(objField);

    Result:=objField;
    END;

    procedure TSTCPipeLine.AfterConstruction;
    begin
    inherited;
    AddFieldsToPipeLine;

    OnGetFieldValue:=GetPipeLineValue;

    InitialIndex:=0;
    end;

    constructor TSTCPipeLine.Create(const AOwner: TComponent;
    const objData: TSTCBusinessObject);
    var
    nRecordCount: Integer;
    begin
    INHERITED Create(AOwner);

    FData:=objData;

    UpdateRecordCount;
    end;

    PROCEDURE TSTCPipeLine.UpdateRecordCount;
    BEGIN
    if FData.InheritsFrom(TSTCListBase) then
    RecordCount:=TSTCListbase(FData).Count
    else
    if FData.InheritsFrom(TSTCDateListBase) then
    RecordCount:=TSTCDateListBase(FData).Count
    ELSE
    RecordCount:=1;
    END;

    destructor TSTCPipeLine.Destroy;
    begin
    inherited Destroy;
    end;

    { TSTCPipeLines }

    procedure TSTCPipeLines.Add(const objPipeLine: TSTCPipeLine);
    begin
    FPipeLines.Add(objPipeLine);
    end;

    procedure TSTCPipeLines.AfterConstruction;
    begin
    inherited;
    FPipeLines:=TObjectList.Create;
    end;

    function TSTCPipeLines.GetPipeLine(
    const nIndex: Integer): TppJITPipeLine;
    begin
    Result:=FPipeLines[nIndex] AS TppJITPipeLine;
    end;

    function TSTCPipeLines.GetCount: integer;
    begin
    Result:=FPipeLines.Count;
    end;

    procedure TSTCPipeLines.UpdateRecordCounts;
    VAR
    cnt: Integer;
    begin
    FOR cnt:=0 TO FPipeLines.Count-1 DO
    TSTCPipeLine(FPipeLines.Items[cnt]).UpdateRecordCount;
    end;

    procedure TSTCPipeLines.ResetRecordCounts;
    VAR
    objPipeLine: TppJITPipeLine;
    cnt: Integer;
    begin
    {Used to signify that report has no data at all}
    FOR cnt:=0 TO Count-1 DO
    BEGIN
    objPipeLine:=Items[cnt];

    objPipeLine.RecordCount:=0;
    END;
    end;

    end.
  • edited August 2005
    Hi Paul,

    In my testing with a simple example (one JITPipeline and one Report),
    setting the RecordCount to 0 gave a blank page. I do not see in the code
    below where you are calling the ResetRecordCounts procedure. Are the
    RecordCount properties for each pipeline being set to 0 in the
    UpdateRecordCount method? If you trace into this code, are you certain
    every pipeline's RecordCount is set to 0?

    If possible, please send a small example demonstrating this behavior in
    action in .zip format to support@digital-metaphors.com.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2005
    I call Resetrecordcounts just before the report is printed

    I will look into providing a demo but this will not be a simple task

This discussion has been closed.