Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Quick report - 2 SQL queries

Posted on 1998-05-01
7
Medium Priority
?
650 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
[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
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
Industry Leaders: 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!

 
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 200 total points
ID: 1340271
Ok glad it helped.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

661 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