Filtering dataset
It is possible to filter the records in a dataset directly in the process of designing without creating a new dataset ad hoc!
In practice I have a dataset (TfrxUserDataSet) that contains all the records, I would like to use it directly within differents databands, but filtering it, to display in a databand records of a type and in another databand records of another type, and then not print records that do not belong neither to the first nor the second type!
It is possible to perform a procedure of this kind?
In practice I have a dataset (TfrxUserDataSet) that contains all the records, I would like to use it directly within differents databands, but filtering it, to display in a databand records of a type and in another databand records of another type, and then not print records that do not belong neither to the first nor the second type!
It is possible to perform a procedure of this kind?
Comments
- What kind of dataset do you have - table or query?
- Is it a problem for you to create some more queries with a specific where phrase?
- What kind of databands are you going to use? Will they all be MasterData or Footer / Group Header/Footer?
TDataSet has two properties: Filter and Filtered. The first is a string, the second is Boolean. You may use it for testing.
But (probably) FastReport may use that filter for filtering records itself and it may take time.
I suggest you to use queries as they are faster and are managed by database engine.
Regards
Mick
The problem is that I don't think in my case it is possible to use a query, as my dataset is of type TfrxUserDataSet, and I haven't a database ADO / DBX like support!
I have to allow some customers to run trivial reports, data are coming from a single table, but they should be filtered according to a specific field.
These customers do not know anything about query/sql, and I wanted to find a simple way, that would allow them to enter text in a field, just the name of the type of data they want to filter and get the report relative!
Something like the field "break on" of the Group header, that allows you to specify a field or expression to generate groups!
thanks
Lorenzo
Shortly - you do that in two passes. First you read all records from TfrxUserDataSet (using Open, Next, Eof, Value properties) and insert them into a table you created in your Database. And having the table and ADO/DBX query you can do whatever you wish [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> If any of the above seems interesting to you then we can continue. But notice - I'm fond of databases[/img][img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> BTW could you say a word about that TfrxUserDataSet - what kind of data is it? Regards Mick[/img]