Please ignore this post and move on to the next Reply
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Hi and thanks again for your answer.
So far I’ve made some progress in adapting my project to the new components, but I still have some basic problems that I don’t quite understand, like I’m having problems with the connection between the component itself and the database tables. With the BDE component the relationship between the component and the tables was done manually, in unbound mode, and now I am encountering very basic difficulties to properly connect everything.
For example, I need to print a series of labels, one for each record in a table, into a page, something very simple as you can see.
- I have the data of the different Labels in one DataSet.
- The data fields of the DataSet are included in the Label file as Variables.
- I connect this dataset via a DataSource to the TListLabel29 component in TListLabel29.DataController→DataSource.
(At this point, if I print the List&Label as it is, it only prints a single label in the page, the first one, but ignores the rest of the labels stored in the DataSet.)
- I’ve found that if I go to the DataController→DetailSources property and add a DetailSourceItem (even though there is no MasterDetal relationship because I only have one table) and set its DataSource as the same as the one I have linked in the component itself as DataController→DataSource, when printing, as many labels appear as I have in the DataSet table, but all of them show the same data: the first label.
So now the number of labels that are printed is correct and they always coincide with the ones I have in the table, but the information shown does not go through the records of the table, it only accesses the first one.
To be honest, I’m a bit lost. Obviously I’m doing something wrong, what do I need to implement to show the information of all the records properly, one label for each one, all in the same page?
Sorry for the trouble, but any help would be appreciated
Thank you very much.
P.S: Before the migration, in the BDE-based component, I used the OnDefineVariables event to load the unbound data into the corresponding variables and then do Next to the DataSet, which left it located on the next record, but I can’t find any similar event in the FireDAC-based component. There is AutoDefineNewPage, which is only triggered when a new page starts (so all the labels in the page are the same) and AutoDefineNewLine, which is triggered when processing Fields, but not Variables (which is what I need for the labels).
EDIT: I have found that the reason why the data is repeated in all the labels is that what is being displayed is the content of unbound variables that were defined only once, so their content never updates.
What I don’t understand is why I need to incorporate a DetailSource to recognise the different fields and records in the table. I thought it was only necessary when you had more than one table and in Master/Detail relationship. If I just assign the DataSource in the DataController, but not the DetailSource, no field from the table is available at the Designer and the printing does not recognise any records.