Board index » delphi » Multiple databases w/QuickReports

Multiple databases w/QuickReports

Quote
Ashley Godfrey wrote:

> Hello all

> After spending 95% of the last 2 years doing Win32 API programming for
> '95 work has decided to place me on Paradox Duty. Basically I am doing
> the database and reporting work that other people here (currently on
> holiday) are specialists at, and I don't have any idea about the
> following problem:

> I have a members/membership database app covering 11 databases. One of
> them is the actual list of members, their names and ID numbers whilst
> another is a stock/inventory database. I need to generate a report
> whereby everyone in the first database is listed in the report, ie their
> name, address etc., and if they have purchased anything  (they will be
> listed in the stock database) I need to display what they have
> purchased.

> The problem I am having is this: I have an SQL statement ("where
> members.memberid = stock.memberid") but this returns only those members
> that have actually bought something - if a member is not listed in the
> stock database then they do not show up in the SQL result and as a
> result they do not show up in the report. Is it possible that as each
> record in the members database is passed I can update the information on
> stock purchases part of the report instantly, regardless of whether or
> not that member has bought anything and is listed?

> Both databases are Paradox tables and each member has a unique number. I
> am currently using individual "Grouped Bands" for the member information
> and stock purchase information. I tried using "OnNeedData" but the event
> was never generated...

> Thank in advance

> Ashley Godfrey.

Hi Ashley.

I'm pretty new to this whole thing myself (fresh out of college, started
my first job here in late December), but I've been working with Delphi
and QuickReports just about the whole time. I've picked up a few things,
and I might be able to help.

It sounds like you need to do the old Master-Detail report. I've done a
few of those. Here's what I'd do:
First, forget the group bands and SQL. You shouldn't need them.

Start by going into the data set of your stock database. Set the
MasterSource porperty to the data source of the member db, and set up
the MasterFields so that it matches the memberid fields of the two dbs.

In QuickReports, start with a detail band, and set it up to display
whatever you want from the member db. Then put a SubDetail band on the
report. Set its Master property to the QuickReport itself, and set its
DataSet to the Stock db. You should then be able to display info from
the stock db on the subdetail band.

If all goes well, the report should print out the info on each member,
followed by all entries from the stock db that relate to them.

Well, I hope this actually helped. If you've got any more questions (or
if I just confused you even more), please post them. You might even get
someone who knows what they're doing to reply. ;-)

Good Luck!
Wade Trupke

 

Re:Multiple databases w/QuickReports


Wade

Fantastic! Did as you suggested and guess what... Worked first time without
any problems what-so-ever! If you ever need any help with WinAPI programming
in Delphi I'd be more than happy to help you out - see the site
http://members.tripod.com/~delphipower for the sort of stuff I can help you
with.

Thak you so much for your help.

Ashley Godfrey.

Other Threads