How To Build Design Time Reports If Using Joins

Using DataAbstract TDAMemTable and DASql, how should we do design time building of field list if we are using joins in the statement?

The issue we are running into is the building of reports in ReportBuilder where we use a single query statement with joins for the datapipeline for the report.

We are unable to establish a design time run of the query that we need to use to build the report with.

This was pretty simple in our old ASTA system. We could run the specified sql statement in design time.

How are others doing this? Probably a simple answer but we are stumped.

Has anyone built a custom component of the DAMemTable that sets up a Sql statement input that can be run in design time? We may have to do this ourselves to simplify the overall system builds. This goes along with that we do not like the FillWithDASql call scenario. This could be a property of the table.

That is what we need. Because of the limitations we have encountered with DASql, we had to build a function to the exact sql statement that we need in certain cases. We use this for many instances where DASql syntax does not have the function calls that we need.

Bill Brittain
Is2 Software

function RoDaExecuteSql( xTable:TDAMemDataTable; xSelectStatement : string ) : Boolean;
begin
  // We want to use this function for executing sql without going thru the DASQL limitations
  xTable.Close;
  try
    Sysfunction.daRemoteDataAdapter.GetDataCall.ParamByName('aSQLText').AsString := xSelectStatement;
    Sysfunction.daRemoteDataAdapter.Fill([xTable], true, true);
  except
    on E: Exception do ShowMessage('Error executing query: ' + E.Message);
  end;
end;

Hi,

as a temporary workaround you can install this package:
package1.zip (6.5 KB)

note: it is designed for Delphi 11. if you are using other version of Delphi, you should replace DataAbstract_IDE_D28 package with your one.

Logged as bugs://D19476.

bugs://D19476 was closed as fixed.

hi @is2software,

You might want to try the temporary package that @EvgenyK mentioned, or update to the latest version of DataAbstract and ReportBuilder since the bug you reported has been fixed.

If you’re still having trouble, creating a custom component for SQL queries could be a good solution.

Thanks… :blush: