Solved

Quick report - 2 SQL queries

Posted on 1998-05-01
7
607 Views
Last Modified: 2010-04-06
Hello,

I want to make a quick report in Delfi 3. In this quick report
there should come a line from one query followed by one or more lines from another query.

I am new to Delfi, but have much experience with other programming platforms.

I have to use queries because the data is in several tables.

However to simplify the problem consider it to be :

Query 1 : select name from customers
Query 2 : select amount from order

I would of course want the two queries to be linked, thus query 2 should be something like
select amount from order where customId = customers.customid.

How do I excatly set up the bands (title band, detail band,...) in order to accomplish this.

Is there a good description of the quick reports available?

Thanks
0
Comment
Question by:pwillems
7 Comments
 
LVL 1

Expert Comment

by:Greedy
Comment Utility
What exactly do you want to do.  Do you know what the different bands do.  One detail band will be printed for each record in the table that you have selected as the reports dataset.  Oh it's is also important that you go get the Quick Reports 2.0j it is the latest one out for non registered useres of the delphi version of quick reports (2.0k if regestered)  You actualy have many ways to do this but what I would probably do is set the dataset proporty of the report to the table that you want each band to print and then use a QRLabel to output the text that you want.  The text to put into the QRLabel will be caculated in the Before print event of the detail band.  so you can do something like this
QRLAbel1.Caption := MyFattyAssQuery.Result
or the equivalent :)
alternatly you could not put a DataSet in for the report and then make your own custom OnNeedData Event for the form...this is a bit more complictadted for a "first timer"
just ask another question if you have a problem.

0
 

Author Comment

by:pwillems
Comment Utility
Hello,

I did buy Delfi 3 10 days ago. I suppose I have the latest version
of the quick report. If not, how can I obtain it (legally).

I think the answer you give does not suit my needs. I do not use
QRlabels for the results of a query but I get the data in automatically while the report prints. However, I get a correct detail band but under it always the same (and thus except for the first) wrong subdetail band.

It is the linking between detail band and subdetail band which gives me trouble.

Another point which gives me trouble is that I can not find the manual for the quick report.

Thanks

Paul
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Pwillems,

Look at the demo's QR itself gave about subdetail bands ...

Regards, ZIF.

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:Greedy
Comment Utility
The manual for Quick reports is on the CD callled Qrpt2man.doc in the \Runimage\DELPHI30\QUICKRPT directory
get the latest copy of quick reports from www.qusoft.com
You most likely have 2.0g you will want 2.0j the way to tell what you have it to right click on the TQuickRep component on the form...not on a band do it outside the margins the popup menu that comes up will tell you the version you can click on it and it brings you to an about box that has the URL that you can click on then go to the download section and pick the one for the delphi users and you'll be fine.  Subdetail band listing isn't too bad once you've seen one work they have a new sample program there too.


0
 
LVL 4

Expert Comment

by:BoRiS
Comment Utility
pwillems

What you can try is select the option you dropped on the report e.g. QrCustomerDBText
then under data set choose one of the Sql Q... you dropped on the form...

Then under the Sql query type the query you wish to run
SELECT 'Customer' from cust.db etc................

Previewbutton.click..........
execute the query and when you call the report qreport1.preview; then the Sql will be run

Later
BoRiS

0
 

Author Comment

by:pwillems
Comment Utility
I was able to do the requested report with the two queries.
It was the comments of Greedy who showed the way I did it.
So, I would like Greedy to answer, so that I can valuate the comments.
0
 
LVL 1

Accepted Solution

by:
Greedy earned 50 total points
Comment Utility
Ok glad it helped.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

6 Experts available now in Live!

Get 1:1 Help Now