Solved

Master-detail in Quickreport

Posted on 2004-04-21
5
808 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
[X]
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

696 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