CrossTab RAP not compiling
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
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
This discussion has been closed.
Comments
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
http://www.digital-metaphors.com
info@digital-metaphors.com
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
http://www.digital-metaphors.com
info@digital-metaphors.com