After the filter there are some more fields which shall be calculated.Why would this be strange?
They behave strange.
On debugging it seems to be, that the already filtered rows are passed on for calculation.
And the bad news:Maybe the filtered SQL can be simplified.
Filtering by SQL-statment right from the DB source will not be possible. The IBquery is a join-request filling half a page. It is too complex.
What does this property IBQuery "SQL filtered" mean in detail?Server side filters (SQLFiltered) are just for dynamically adding WHERE to the SQL clause.
There is a hint in the manual about "server side filters", which does not say too much to me.
What can I do, that the IBquery CalcFields just work with my already "FilteredRecords"?You could check in CalcField if the record is filtered, and if so, just skip the calculation.
Why I want to filter first and calculate after it?What is the calculated field?
Because it is quicker to calculate a bundle of figures instead of all of them.
...
There a generated sorted groups of "comm".
Or is there a way to DELETE rows of myquery in the filter event?How about putting a line like this at the top of OnCalcField?
Or is there a way to DELETE rows of myquery in the filter event?No. The only way is to not send the records to the client in the first place.
A IBQuery populates a DBStingGrid.The use of OnFillterRecords is really a bit of a hangover from Paradox and other non-SQL databases. The assumed model is that each dataset (e.g. TIBQuery) is a table and you want to select only a subset of the table's rows. You have to do this clientside with Paradox as the underlying database doesn't really give you much help. OnFilterRecords should still work with a modern database, such as Firebird, but it is far better to add a conditional clause (e.g. WHERE...) to your SQL query and get the database to do the work for you (this is server side filtering). This is even more important when using a remote server as using conditional SQL reduces the data over the network.
This Query is filtered by OnFilterRecords and does as it should.
The data-fields are fine.
Not quite true. The sequence is that first the row is fetched from the database, OnCalcfields is then called to calculate the field values and then OnFilterRecord to filter out those you don't want. This allows your filter to work on calculated and well as data fields.
Next step:
After the filter there are some more fields which shall be calculated.
They behave strange.
On debugging it seems to be, that the already filtered rows are passed on for calculation.
See section 6.3.2.2 in the user guide.
I checked the manual.
There I found, I can set "SQL filter" to true and this is just for "tables".
?!
I am clueless about the details, and what I tried did not work.
And the bad news:
Filtering by SQL-statment right from the DB source will not be possible. The IBquery is a join-request filling half a page. It is too complex.
What does this property IBQuery "SQL filtered" mean in detail?
There is a hint in the manual about "server side filters", which does not say too much to me.
Can I use it at all?
and: I use a local server.
That's one thing you can't do. The order is first calculate the field values and then apply the client side filter and that is hard wired. Use SQL filters (server side) if you want to calculate fields on a filtered dataset. Even better, also add calculated fields to your SQL query
Or in other words:
What can I do, that the IBquery CalcFields just work with my already "FilteredRecords"?