DirectSQL not showing all data

Hi,

I am using SQLDirect to create my excel files, my template have a Pivot TABLE, so the SQL will fill the Data worksheet with the result.

The Data Worksheet have  only 24 rows of data, but the SQL result on IBExpert ( I am using firebird ) shows 107 records.

I am following the SQLDirect sample, But I am trying to undersand, why the data worksheet doesn´t have the same result as I have on ibexpert.

Is there something to check out?

Thanks,
José Carlos.




Hi,

Can you try setting the last parameter of add connection to TRecordCountMode.SlowCount ?

Like:
   Report.AddConnection('Northwind',
      function (const sql: string): TDataSet   //We need to return a new TDataSet here, FlexCel will free it.
      var
        ds: TADODataSet;
      begin
        ds := TADODataSet.Create(nil);
        ds.Connection := ReportData.ADOConnection;
        ds.CommandText := sql;

        Result := ds;
      end, 
       TRecordCountMode.SlowCount
      );

I am not sure on what components you are using, but they might not be returning the right record count. If you are using FireDac, instead of using SlowCount as said above, you might change RecordCountMode ( http://docwiki.embarcadero.com/RADStudio/XE7/en/Fetching_and_Populating_Q
uestions_(FireDAC)  )

If htis is using IB components directly, then just use SlowCount.

For more information please amke sure to read the section:
About RecordCount in DataSets
in UsingFlexCelReports.pdf

Let me know if this fixes it.

It worked, I got all records adding SlowCount

Thanks,
José Carlos.