Dynamic Fields

I Attacted Datasource in delphi to frxDataSet1 in FastREport.
It's ok when i use <frxdataset1."Name">,<frxdataset1."Address">. But How i can call Field Value dynamicly like Fields[1], or FieldByName by code?

when i use :
1. Value := <frxdataset1."'+FieldByName+"> ; Error! ;)
2. Value := <frxdataset1."'+Fields[1]+"> ;Error ! ;)

Thank for your attension

Endry

Comments

  • dschuchdschuch Dresden,Germany
    edited 7:50PM
    good question. For that purpose I wrote a own function that i call from inside FR. The Return Value is FieldByName - Value of the requested DataSet.


    function GetDynamicField(DataSetName, FieldName : String) : Variant;

    In Delphi with FindComponent(DataSetName) -> FieldByName(FieldName)...

    Daniel

Leave a Comment