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

CrossTab RAP not compiling

edited February 2003 in RAP
Any idea why this code is not compiling at report run-time.

procedure CrossTab1OnGetCaptionText(aElement: TppElement; aColumn: Integer;
aRow: Integer; const aDisplayFormat: String; aValue: Variant; var aText:
String);
begin
if (aElement is TppRowDef) and (TppDimension(aElement).FieldName='time')
then
aText := 'MyString';
end;

TIA

Comments

  • edited February 2003
    There is no RAP RTTI classes defined for TppRowDef. If you want to check
    this class you can create a TraTppRowDefRTTI class and register it. Or you
    can create a RAP pass through function that check the class type and returns
    a boolean if it is TppRowDef in the pass through function. Please see the
    ppCTMain.pas for an example of registering TraTpp*RTTI classes for Tpp*
    classes. There are examples of creating RAP pass through functions in the
    RAP tutorials directory of the installation and also a step by step in the
    Developer's Guide in RB 7, which is adapted fromt he original help file on
    RAP which also describes pass through functions.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited February 2003

  • edited March 2003
    The reason that the first compiles and the scodn does not is because RAP
    only knows what is published in Delphi, or what TraRTTI classes tell it.
    TppDimension publishes FieldName as a property, while TppElement does not,
    as TppDimension is a descendent of TppElement. You will have to declare new
    RAP TraRTTI classes to surface this property on the element class, or create
    a RAP pass through function to perform this operation with the element. The
    pass through function is the easier way to go with this IMO.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.