Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Master-detail in Quickreport

Posted on 2004-04-21
5
806 Views
Last Modified: 2013-11-22
Hi, I have a question. It has been asked multiple times, but I can't get things the way I want. Here is mys problem:
I have 2 tables: Artikelgroep.db and Artikel.db; fields in Artikelgroep.db: artikelgroep, artikelgroepID
                                                                    fields in Artikel: ArtikelgroepID, omschrijving, btw,...
I would like to use a TQuery to do the following in a Quickreport:

Artikelgroep1
  omschrijving1
  omschrijving2
Artikelgroep2
  omschrijving1
  omschrijving2  // so a master-detail

I read the answers asked before, tried everthing, from QRGroup to QRdetail; the only thing I get is
Artikelgroep1
  omschrijving1
Artikelgroep2
  omschrijving2
Artikelgroep2
  omschrijving1
....

Can you help me as soon as possible ?
thx a lot

0
Comment
Question by:marioway
  • 3
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 125 total points
ID: 10876724
similar to a qr-q that i've last answered

use one query like

select * from Artikelgroep ag, Artikel a where ag.artikelgroepID = a.artikelgroepID order by ag.artikelgroepID

use a quickreport-layout like

+-------- Groupband1 - GroupExpression = Dataset.artikelgroepID -
| [Field] [Field] ....
+-------- DetailBand - ---------------------------------------------------
| [Field] [Field] ....

hope this helps

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10876740
btw.

>I read the answers asked before, tried everthing, from QRGroup to QRdetail ...

guessing you're query didn't have an order by clause
-> its very important, that the query is sorted like your grouping-scheme

meikl ;-)
0
 

Author Comment

by:marioway
ID: 10877436
Hi, I've tried your solution, but what I got :

Artikelgroep1
  omschrijving1
  omschrijving2
  omschrijving1

This is the query I use: SELECT Artikelgroep.ArtikelgroepID, Artikel.Omschrijving, Artikel.ArtikelgroepID, Artikel.Code, Artikel.Stukprijs, Artikel.Btw, Artikel.Prijsexclbtw, Artikel.Prijsinclusiefbtw, Artikel.Volumepunten, Artikel.ArtikelID
FROM "artikel.DB" Artikel, "artikelgroep.DB" Artikelgroep
WHERE  Artikel.ArtikelgroepID = Artikelgroep.ArtikelgroepID
ORDER BY Artikelgroep.ArtikelgroepID

On Quickrep1: Group-band and detail-band.
Dataset for TQuery --> ?
Dataset for Quickrep1 I set to Query (in my case Query20)

Did I forget something ? Group by for instance ?

thx
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10877531
did you set the groupExpression?

>Dataset for TQuery -->
guessing you mean the Dataset-property of the TQuery
-> should be empty (nil)

>Group by for instance ?
a group by cluase is only needed,
if you have aggregate-functions within the query like sum/max/etc.

it looks ok for me,
except i miss the
Artikelgroep.Artikelgroep-field
in your query

don't hestitate to send me your report via email
(you found my email in my profile)

i guess its some marginal adjustment to
get it work like expected, but its hard to solve from far for me

meikl ;-)
0
 

Author Comment

by:marioway
ID: 10882439
Hallo, I think I found the problem: in QRGroup - expression I put: artikelgroep.ArtikelgroepID; now I changed it to ArtikelgroepID (without the artikelgroep.) . And it works fine.

I thank you very much for your time and effort.

marioway
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question