Locate with FireDac FDTable

edited 3:07PM in FastReport VCL
I'm using the latest version of FastReport FMX with Rio 10.3. I'm converting my project from IBX components to FireDAC. All the FastReport FireDac components seem to compile and install properly. I connect to the database and the FD components appear on the form data tab. With IBX I made extensive use of the Table1.Locate command throughout my source. When I replaced the tables with the FD equivalent, I get an error on Table1.Locate.

Is this not supported with FastReports and FireDac? Or is there something else I need to do?

thank you

Comments

  • gpigpi
    edited 3:07PM
    Try to modify FMX.frxFDRTTI.pas
    function TfrxFDFunctions.GetProp(Instance: TObject; ClassType: TClass;
      const PropName: String): Variant;
    begin
      Result := 0;
    
      if ClassType = TFDQuery then begin
        if PropName = 'PARAMCOUNT' then
          Result := TFDQuery(Instance).ParamCount;
      end
      else if ClassType = TFDStoredProc then begin
        if PropName = 'PARAMCOUNT' then
          Result := TFDStoredProc(Instance).ParamCount;
      end
      else if ClassType = TfrxFDDatabase then begin
        if PropName = 'DATABASE' then
          Result := Integer(TfrxFDDatabase(Instance).Database);
      end
      else if ClassType = TfrxFDTable then begin
        if PropName = 'TABLE' then
          Result := Integer(TfrxFDTable(Instance).Table);
      end
      else if ClassType = TfrxFDQuery then begin
        if PropName = 'QUERY' then
          Result := Integer(TfrxFDQuery(Instance).Query);
      end
      else if ClassType = TfrxFDStoredProc then begin
        if PropName = 'STOREDPROC' then
          Result := Integer(TfrxFDStoredProc(Instance).StoredProc);
      end;
    end;
    
  • edited 3:07PM
    gpi wrote: »
    Try to modify FMX.frxFDRTTI.pas
    function TfrxFDFunctions.GetProp(Instance: TObject; ClassType: TClass;
      const PropName: String): Variant;
    begin
      Result := 0;
    
      if ClassType = TFDQuery then begin
        if PropName = 'PARAMCOUNT' then
          Result := TFDQuery(Instance).ParamCount;
      end
      else if ClassType = TFDStoredProc then begin
        if PropName = 'PARAMCOUNT' then
          Result := TFDStoredProc(Instance).ParamCount;
      end
      else if ClassType = TfrxFDDatabase then begin
        if PropName = 'DATABASE' then
          Result := Integer(TfrxFDDatabase(Instance).Database);
      end
      else if ClassType = TfrxFDTable then begin
        if PropName = 'TABLE' then
          Result := Integer(TfrxFDTable(Instance).Table);
      end
      else if ClassType = TfrxFDQuery then begin
        if PropName = 'QUERY' then
          Result := Integer(TfrxFDQuery(Instance).Query);
      end
      else if ClassType = TfrxFDStoredProc then begin
        if PropName = 'STOREDPROC' then
          Result := Integer(TfrxFDStoredProc(Instance).StoredProc);
      end;
    end;
    


    Finally able to try this but still get error: "Unknown type TfrxFDTable" on the mytable.Locate command
  • gpigpi
    edited 3:07PM
    Try mytable.Table.Locate
  • edited 3:07PM
    gpi wrote: »
    Try mytable.Table.Locate

    still same error "Unknown Type: TFrxFDTable" I recompiled all after changing the code, the table displays in the data tree with all fields

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.