master/detail
Hi guys
1)
I'm "fighting" with a triple master/detail stuff and would like you to point me and help me with:
I've these entities
Company -> Orders -> Products
How should I links these 3 entities, talking about primary keys, foreign keys, etc. so i build a tri master/detail stuff (hope this to be the name for this kind of relation) ?
2)
after 1) how could I build a report, using 4 eg. FastReport, and how could I load data into report @ runtime, and not designtime, coz I'd build data using queries...
I just need a quick and easy approach, so I can learn to manage this... just that...
Hope you've understood my idea and hope your help...
Thanks a lot in advance.
1)
I'm "fighting" with a triple master/detail stuff and would like you to point me and help me with:
I've these entities
Company -> Orders -> Products
How should I links these 3 entities, talking about primary keys, foreign keys, etc. so i build a tri master/detail stuff (hope this to be the name for this kind of relation) ?
2)
after 1) how could I build a report, using 4 eg. FastReport, and how could I load data into report @ runtime, and not designtime, coz I'd build data using queries...
I just need a quick and easy approach, so I can learn to manage this... just that...
Hope you've understood my idea and hope your help...
Thanks a lot in advance.
Comments
Thz
I saw demo, but it is not what I need.
I need an example the code to fill with data the form in run time. I already have armed to the report with details and subdetails.
I hope that you understand to me, and thanks to respond
in my app i had 2 problems:
1) i need data in depends from Values of fields. So i wrote a Own functions named
SQL_PREPARE(SQLSTRING : String);
SQL_OPEN;
SQL_GETFIELD(FIELDNAME : String);
I call this funciton from inside my report and let Delphi open a query with sqlstring (1 st and 2 nd function), and let delphi return the value of the field called "FieldName" (3 nd function)
2) my Databindings aren't hardcoded so i create my datasets at runtime. To link them to FR i create TfrxDBDataSet at runtime too, set DataSet to my runtimedataset and use
frxReport1.DataSets.Add(Components AS TfrxDBDataSet)
to publish them to FR.
Perhaps i awnsered some of your problems but i cant understand you really. Or which form do you want to fill with runtimedata?
but it seems to me that we are not speaking of the same.
if you have a time I tell you as it is the problem:
1) I must show a report in this order with: (the leaf of the report already this ok)
MASTERDATA
|-- custmers.company
DETAILDATA
|-- Order No
SUBDETAILDATA
|-- Item.Part Item.Name Item.Price Item.Qty
(FastReport 3 brings one demo of something asi but with full data bases BDE already loaded and of data.)
2) everything in run time, and data base nexusdb.
1) SQL_QUERY(select customers_id, customers_company from customers)
2) SQL_QUERY(select orders_idsale from orders where orders_idcustomers = customers_id group by orders_idsale)
3) SQL_QUERY(select item.cod, item.name, item.price, item.qty from item where item_norders = orders_idsale)
Now I while in run time I am reading the results of the SQL_QUERY, and need to be filling the report soon to be shown.
I wait for you understand my problem to me since for my he is very complicated.
and sotty by my ingles translated in google.
thz
You need a
MasterData - Band,
DetailData - Band and a
SubDetailData - Band.
Assign the correct DataSet to each Band. You can create your Query components at designtime in Delphi and link them with TfrxDBDataSet to FR. So you have you DataSets in the DataTree and use them.
You need to use DataSource/MasterSource to link your querys. Read the documentation and see the source code of the examples.
Daniel.
I can data pass ok!! thz
but I need something like this example:
the first SQL works well, the second also works ok, but in the report it shows the data of last nxQuery2.
I hope you understand to me, thanks