Home General

Advice on getting this to work

edited August 2001 in General
Hi.

I'm trying to convert a report from quickreports to RB 5.56, but I simply
cannot get the same result. The important point to note is that I want to
use completely self enclosed reports that get saved as a template to our
database. This means that all the TQueries used to build the original QR
are of no use to me. Basically I have a table called SYSTEM_TYPE defined as
follows.

SYSTEM_TYPE_ID INT PK
SYSTEM_TYPE_DESC C(40)

I have another table called SYSTEM that links to SYSTEM_TYPE via a foreign
key on the field SYSTEM_TYPE_ID. Now what I want to achieve is to list the
field SYSTEM_TYPE_DESC from all the records in SYSTEM_TYPE alongside a count
of how many records in SYSTEM have that SYSTEM_TYPE_ID. The original report
had six columns. The first containing the description of the system type,
and the next five having a slightly different variation of the same query -
the only difference being a check on another field, STATUS_ID. So it looked
like this

STATUS_ID=1 STATUS_ID=2
STATUS_ID=3 etc
SYSTEM_TYPE_DESC COUNT COUNT COUNT

type1 5 2
4
type2 0 8
1

etc....

So I had a different TQuery for each column, all linked via the Datasource
property to the first query which was simply an ordered select * from
SYSTEM_TYPE. The way I have tried to emulate this is that the first query
in the DADE selects all system types - works fine on it's own. Then another
one selects a count of all records with STATUS_ID=1 and this is linked to
the first query. All this does is to list the SYSTEMS (not all of them and
not in the order I want) and then lists the same count value for each row.
I have wasted many hours on this now. I am getting a little frustrated as I
thought it was supposed to be simple to do things like this. I have studied
the tutorials and can't get any further forward. I know this is a long
winded post but I hope someone can understand me and lend a hand.

TIA

John.
--
I don't like spammers so send your spam to
abuse@hotmail.com

Comments

  • edited August 2001
    To see the SQL that is being generated, Crtl-click over the dataview- you
    should have a window popup with the actual SQL that is going to be set to
    the server. What does the SQL look like? Is it incorrect? Try upgrading
    to RB 6.01 Contact info@digital-metaphors.com with your full registration
    information.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    "Jim Bennett (Digital Metaphors)" wrote in
  • edited September 2001
    Just a little more background to hopefully help someone figure this out for
    me. How does RB figure out which fields to list in the link as detail
    dialogue? I say this because if I press the link button on the dataview
    that I want to be the detail dataview it does not show any fields in the
    Linked fields box. Neither does it list any fields in the detail box, so I
    cannot create the desired link that way either. I must surely be missing
    something somewhere? Woudl it help to post screen shots of the dataviews
    and the link dialog?
  • edited September 2001
    John Faris" wrote in message
  • edited September 2001
    > Even more weird. I have now found that the dataviews can be linked the
    the
    the

    Note to self: Remember to read instructions before complaining that things
    don't work. I just read the following in the pdf guide:-

    "To establish a master detail relation-ship, the detail table must be
    indexed on the linking field value or values. "

    Hmm. Tried it and hey presto it worked, although I had to recreate the
    detail dataview before it would allow me to create the view I wanted.

    John.
This discussion has been closed.