Problem getting fields lists and fields aliases from a frxCustomDataset
Hello, I declare in a function a variable named dataSet, its type is TfrxCustomDataset. The problem is that I'm trying to get the fields names and fields aliases, but when I work with this dataSet variable in a loop, the error Index out of bounds is shown. Originally I have 2 other variables: fieldsAliases and fieldsNames (TStringList).
The procedure I'm using is this one:
Let's assume that this can be replaced by the function dataSet.GetFieldList(fieldList). When I do it, the values of my fieldList's strings receive the fields' aliases actually. I'd like to solve this: get the field's lists and field's aliases in the respective variables. Thanks.
The procedure I'm using is this one:
procedure TfrmFiltraRelatorio.FormCreate(Sender: TObject);
var
  i: Integer;
  fieldList, fieldAliases : TStringList;
begin
  fieldList    := TStringList.Create;
  fieldAliases := TStringList.Create;
  for i := 0 to Pred(dataSet.FieldsCount) do
    fieldList.Add(dataSet.Fields.Fields[i].FieldName);
end;
Let's assume that this can be replaced by the function dataSet.GetFieldList(fieldList). When I do it, the values of my fieldList's strings receive the fields' aliases actually. I'd like to solve this: get the field's lists and field's aliases in the respective variables. Thanks.
Comments
Yes Mick, I have the same error
Hava a look at sample code below, maybe it will help you anyway: Let us know if they answer your ticket. The solution may be usefull for many FR users.
Thnx Mick, here is the link to the ticket http://support.fast-report.com/tickets/251922
Thanks for the help again!