How can I use detail information in Qreport using a Mastertable

I have a report for Invoicing. In my detailtable I have Items loading, delivery, etc... I need to know at every masterrecord for example the date in detailrecord loading, delivery, rail, etc... How can I do this ? Structure : Invoicetable (Invoicenr, invoicedate, jobnumber)
Ex. 80001, 15/08/98, 10001
Ordertable : Jobnumber, weight, container
10001, 8000,TEST01
Ord_itemtable : Jobnumber, item, date1, date2 (ex.
10001, LOADING, 15/08/98, 17/08/98
10001, DELIVERY, 19/08/98,19/08/98
10002, LOADING, 15/08/98, 16/08/98)
What I need is a report with details ex.
80001 (invoice), loadingdate (15/08/98 - 17/08/98), delivery (19/08/98-19/08/98), weight, container
Who is Participating?
dwwangConnect With a Mentor Commented:
Firstly, you shold know how to build master-detail querys, with those two queries, you can put a detail band and a sub-detail band on the report.

Then set the dataset of the detail band to the master query, and the dataset of sub-detail band to detail query. Also set the master property of the sub-detail band to the report you are designing.

then you get all done, any questions, please tell me.
heh? sorry.
Hi, I hope this is a rather easy question, however it is not so easy to talk here, maybe you can give the data structure here and I can e-mail you ome examples.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

AntoninosciarrinoAuthor Commented:
Edited text of question
hi Antoninosciarrino,

it can be done with one query also

the sqlstatement:

select * from table1, table2 whrere table1.orderno = YourInputOrderno and table1.orderno = table2.orderno

the fields for the head place in the pageheader-band
the fields for the posistions in your invoice place in the detail-band

hi Antoninosciarrino,

i see you've three tables.

the statement then could be

select * from invoicetable, jobtable, itemtable where invoicetable.invoicenr = YourInputInvoiceNr and  invoicetable.invoicenr =  jobtable.invoicenr and jobtable.jobnr = itemtable.jobnr

(-> this select all jobs per InvoiceNr)

append for only one job :

and jobtable.jobnr = YourInputJobNr

for sortorder append

order by tablename.fieldname, ...

Tip : use phisical tablenames in the sqlstatement not TTable-componentnames
* selects all fields from all tables to specify fields you you must name the fields instead of  * i.e select tablename.fieldname, ... from ...

placing the fields in your report see above

AntoninosciarrinoAuthor Commented:
kretzschmar's answer was clearer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.