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

JitPipeLIne and Devexpress Grid 5

edited April 2006 in Datapipelines
Hi there!

I tried to use the JITPipeline to get Data from a Devexpress-Grid which
allows me to filter and sort the data before I print it. I use this
code:
-----
Function TForm1.ppJITPipeline1CheckBOF: Boolean;
begin
Result := vResult.DataController.IsBOF;
if Result then cxMemo2.Lines.Add('BOF');
end;

function TForm1.ppJITPipeline1CheckEOF: Boolean;
begin
Result := vResult.DataController.IsEOF;
if Result then cxMemo2.Lines.Add('EOF');
end;

function TForm1.ppJITPipeline1GetActive: Boolean;
begin
Result := True;
end;

procedure TForm1.ppJITPipeline1CloseDataSet(Sender: TObject);
begin
cxMemo2.Lines.Add('CloseDataSet');
end;

procedure TForm1.ppJITPipeline1FreeBookmark(aBookmark: Integer);
begin
cxMemo2.Lines.Add('FreeBookMark ' + IntToStr(aBookmark));
end;

function TForm1.ppJITPipeline1GetBookmark: Integer;
begin
Result := vResult.DataController.RecNo;
end;

function TForm1.ppJITPipeline1GetDataSetName: String;
begin
Result := 'DataSetName';
end;

function TForm1.ppJITPipeline1GetFieldAsDouble(aFieldName: String):
Double;
begin
Result :=
vResult.DataController.Values[vResult.DataController.FocusedRecordIndex
,0];
end;

function TForm1.ppJITPipeline1GetFieldAsString(aFieldName: String):
String;
begin
Result :=
vResult.DataController.Values[vResult.DataController.FocusedRecordIndex
,0];
end;

procedure TForm1.ppJITPipeline1GotoBookmark(aBookmark: Integer);
begin
vResult.DataController.RecNo := aBookMark;
end;

procedure TForm1.ppJITPipeline1GotoFirstRecord(Sender: TObject);
begin
vResult.DataController.GotoFirst;
bNextRecIsEof := False;
end;

procedure TForm1.ppJITPipeline1GotoLastRecord(Sender: TObject);
begin
vResult.DataController.GotoLast;
end;

procedure TForm1.ppJITPipeline1OpenDataSet(Sender: TObject);
begin
cxMemo2.Lines.Add('Open DataSet ' +
IntToStr(vResult.DataController.FilteredRecordCount));
end;

procedure TForm1.ppJITPipeline1RecordPositionChange(Sender: TObject);
begin
cxMemo2.Lines.Add('RecordPosChange ' +
IntToStr(vResult.DataController.Recno));
end;

procedure TForm1.ppJITPipeline1TraverseBy(aIncrement: Integer);
begin
vResult.DataController.MoveBy(aIncrement);
end;

function TForm1.ppJITPipeline1GetFieldValue(aFieldName: String):
Variant;
var
nIndex : Integer;
begin
nIndex := vResult.GetColumnByFieldName(aFieldName).Index;
Result :=
vresult.DataController.Values[vResult.DataController.RecNo-1,nIndex];
end;
-----

But the detection of Eof is wrong (i have 2 records less). Did somebody
else something like this before with more success and can share the
code with me?
Thanks.

Gruß aus den Bergen
Günter

Comments

  • edited April 2006

    Here is an example of using the JITPipeline over a TDataSet. It demonstrates
    that JITPipeline.Eof works the same as DataSet.Eof.

    www.digital-metaphors.com/tips/DataSetViaJIT.zip

    You can also check out the source code to the JITPipeline. Open ppDBJIT and
    search for FEOF. You can see how it works - that might be helpful as well.





    Best regards,

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