Solved

Master-detail in Quickreport

Posted on 2004-04-21
5
801 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now