Quick reports use an intermediate object descending from _TFrxDataSet to connect the report engine that it prints.
To connect a report to a data source controlled by the program itself, you use the TfrxUserDataSet component, which allows you to see the data set inside the report, but you manually specify the column names in the Fields (TStrings) property and control and feed values programmatically record event handlers for the following events:
- OnCheckEOF is functionally equivalent to OnNeedData, if there is no more printing, you set the EOF var parameter to true
- OnFirst you do everything you need to start your data search.
- OnGetValue and OnNewGetValue you provide values for each of the different columns of the current row
- OnNext , OnPrior you move the current line to the next or one previous position.
As you can see, the concept of a row / column (DataSet) is used to represent data in a report, but you can extract data from any structure used to store the results of your calculations (lists, arrays or any other object / structure / file, etc. )
Inside the report, you bind a group to this logical DataSet and use standard components to print the column values of this data set.
If you already have data in a DataSet, for example, in a DataSet in memory after your calculations, it is better to use TfrxDBDataset to directly bind your report to this data source.
source share