Solved

Quick report - 2 SQL queries

Posted on 1998-05-01
7
618 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
ID: 1340265
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
ID: 1340266
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
ID: 1340267
Pwillems,

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

Regards, ZIF.

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:Greedy
ID: 1340268
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
ID: 1340269
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
ID: 1340270
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
ID: 1340271
Ok glad it helped.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 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