The new TfrxReport.EnabledDatasets property

Currently available FR 3.0 build and CBuilder 5.

I have not been able to find the new TfrxReport.EnabledDatasets property in the current distribution of FR 3.

The changes.txt indicates that this is version 3.01 however designer still says FR 3.0.

I am assuming that this property is to address the problems of referencing valid datasets in non data linked bands like Page Header and Report Title etc.

The inability to do this is a real show stopper for me.


Comments

  • edited September 2004
    This property limites the number of datasets available to a report.
    To solve non-databands problem, fix the
    frxDBSet.pas:
    function TfrxDBDataset.GetDisplayText(Index: String): String;
    var
      i: Integer;
    begin
      if not FInitialized then
        Initialize1;
      if DataSetActive then
        if Fields.Count = 0 then
          Result := FDS.FieldByName(Index).DisplayText
        else
        begin
          i := Fields.IndexOf(Index);
          if i <> -1 then
            Result := TField(Fields.Objects[i]).DisplayText
          else
          begin
            Result := frxResources.Get('dbFldNotFound') + ' ' + UserName + '."'
    +
              Index + '"';
            ReportRef.Errors.Add(ReportRef.CurObject + ': ' + Result);
          end;
        end
      else
        Result := UserName + '."' + Index + '"';
    end;
    
    function TfrxDBDataset.GetValue(Index: String): Variant;
    var
      i: Integer;
    begin
      if not FInitialized then
        Initialize1;
      i := Fields.IndexOf(Index);
      if i <> -1 then
        Result := TField(Fields.Objects[i]).Value
      else
      begin
        Result := Null;
        ReportRef.Errors.Add(ReportRef.CurObject + ': ' +
          frxResources.Get('dbFldNotFound') + ' ' + UserName + '."' + Index +
    '"');
      end;
    end;
    

Leave a Comment