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

DataPipeline vs TDataSet Data Access

edited November 2003 in General
Some background information for a question:

I have a very simple TppReport that I have designed.
My TppReport's DataPipeline property refers to ppDBPipeline1.
My ppDBPipeline1's DataSource property refers to
frmScrSeriesInput.dsTapeQuery.
The DataSource (frmScrSeriesInput.dsTapeQuery) refers to an Advantage
Database Query called AdsqTapeQuery.

On my TppReport's TppDetailBand I have a TppLabel whose Caption property I
load using the TppDetailBand's BeforePrint event. I want the caption
property to contain the content from two character fields from my TDataSet
(AdsqTapeQuery). To do this I have normally been concatenating the two
fields by directly referring to the actual TDataSet component's FieldByName
property to get my values which seems to work just fine like so:

with frmScrSeriesInput.AdsqTapeQuery do
begin
ppLabel1.Caption := FieldByName('Value1').AsString + FieldByName
('Value2').AsString;
end;

I also understand that instead of referring to the actual source query, I
could also refer to the ppDataPipeline1 as well like this:

ppLabel1.Caption := ppDBPipeline1['Value1'] + ' ' + ppDBPipeline1
['Value2'];

My question is this...Which of the two ways listed is the preferred way to
access values considering that the values are ultimately coming from the
same source? Aside from the second way involving a little less code, are
there other benefits or are they both fairly equal?

Thanks,
Steve Swarner

Comments

  • edited November 2003
    "Nico Cizik \(Digital Metaphors\)" wrote
  • edited November 2003
    Hi Steve,

    Personally, I've always used the datapipeline
    (Report.Datapipeline['FieldName'];) to access a dataset but there should be
    no difference between this and accessing the TDataSet directly. You should
    not loose or gain any performance or resources by using one over the other.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.