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

Auto Search Field

edited November 2012 in General
Hi

I am writing a procedure that creates the auto Search Criteria in code from
values in a table i.e.

ppReport1.CreateAutoSearchCriteria(rbAutoParamsTable.FieldByName('ADATAPIPELINE').AsString,
rbAutoParamsTable.FieldByName('AFIELDNAME').AsString,
rbAutoParamsTable.FieldByName('AOPERATOR').AsString,
rbAutoParamsTable.FieldByName('AEXPRESSION').AsString,
rbAutoParamsTable.FieldByName('AMANDATORY').AsString);

how do I get the value 'rbAutoParamsTable.FieldByName('AOPERATOR').AsString'
into the form of TppSearchOperatorType?

I have looked through the examples but all I can find are examples where you
use soLike etc. directly in the function rather than passing the values from
a database.

Thanks in advance.

Philip L Jackson

Comments

  • edited November 2012
    There is a ppGetEnumValue function defined in ppEnum.pas that can convert an
    enum name to an ordinal value and then you can typecast the ordinal value.
    Would look something like this...

    uses
    ppTypes,
    ppEnum;

    liEnumValue := ppGetEnumValue(TypeInfo(TppSearchOperatorType), lsEnumName);
    lSearchOperator :- TppSearchOperatorType(liEnumValue);


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

    Best regards,

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