Home RAP

Report not working after upgrade from 9.x to 11.05 (from .general group)

edited October 2009 in RAP
The same report that I reported a problem with in a .general thread also
has a problem with some RAP code.

(I know you have asked for a test app to allow you to duplicate it. I'm
working on it.)

The following is an example of some RAP code which is not getting
executed correctly.

if Rebate_Totals_Invoice['InvSlsbyAR QtyShip']= 0 then
begin
Value := Rebate_Totals_Invoice['Sum(InvSlsbyAR QtyOrdrd)'];
end
else
begin
Value := Rebate_Totals_Invoice['InvSlsbyAR QtyShip'];
end;

As reported in the other thread, the first issue appears to be the
change in implementation of procedure TdaMagicSQL.UpdateSQLFieldNames;
from 9.03 to 11.06

I went ahead and restored that method in 11.06 to that of 9.03 to see if
I could continue my debug and in doing so have discovered why the above
RAP Code is not executing correctly.

The problem is in function TppDBPipeline.GetFieldValue(aFieldName:
string): Variant; located in ppDBPipe.pas

The actual object instantiated is a TppChildDBPipeline

9.03 version

function TppDBPipeline.GetFieldValue(aFieldName: string): Variant;
begin

Result := Null;

if not SetCurrentField(aFieldName) or (ppdaNoRecords in State) then Exit;
.
.
.
end;

11.06 version

function TppDBPipeline.GetFieldValue(aFieldName: string): Variant;
var
lField: TField;
begin

Result := Null;

if (FDataLink.DataSet <> nil) then
lField := FDataLink.DataSet.FindField(aFieldName)
else
lField := nil;

if (lField = nil) or (ppdaNoRecords in State) then Exit;
.
.
.
end;

The problem is this. In 9.03 the value of State changes from
[ppdaNoRecords] to [ppdaFirstRecord]

In 11.06 it never changes and remains [ppdaNoRecords]

I could help you further identify issues if the property State

property State: TppDataPipelineStates read FState write FState;

used a set method instead of accessing the field directly as I could
then set a breakpoint. I tried adding a Set method for the property,
but unit raIDE.dcu is dependent so there was a version mismatch on the dcus.

Still working on the example.

Comments

  • edited October 2009
    Also, even though the State value is [ppdaNoRecords] in 11.06, the field
    is there and the value in it is correct. It just not being returned
    because the method

    TppDBPipeline.GetFieldValue(aFieldName: string): Variant;

    prematurely exits when

    if (lField = nil) or (ppdaNoRecords in State) then Exit;

    is executed.

  • edited October 2009
    To: Nard Moseley
    CC: Tom Jacobs (Exact Software)
    CC: ElevateSoft Support (FYI only)

    I took the trouble to try the sample app out in the configuration as you
    described.

    Clean install of Delphi, RBuilder, and DBISAM 4.26 Build 3 on D2007
    (even though I use D7)

    RBuilder and DBISAM are the only components installed.

    I still have the same issue demonstrated.

    What do I have to do to escalate this?

    Mark

  • edited October 2009
    Please do not crosspost. Please see my reply to your thread in General.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

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