Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Reading a table just once

edited October 2002 in End User
Hi,

How can I read a table just once?

I have a table that I need to print.
One field of this table is the company code and using that value I need to
access the Company table to get the company information to be printed in the
header of the report.
I have an AutoSearch criteria for the company code, defined as soEqual,
mandatory, so only data refered for one company will be extracted from the
main table.

If I put a second query in the DADE, linked as a detail of the main table by
the company code, the report takes a lot of time, about 10 minutes (in the
detail table there is also the bitmap of the company logo), to be printed.

If I disconnect the company table, it takes 3 seconds to be printed.

How can I access the company table, only after reading the first record of
the main table, avoiding further access?
I could also read the company table using the value put in the autosearch
criteria for the company code, but how can I code all of this in RAP?

Thank you.

Antonio Budano
ALTAIR net S.r.l.

Comments

  • edited October 2002
    DADE works by generating a single detail query that returns all records for
    the details for all masters. This way they can be traversed without having
    to send additional detail queries (which would be slower overall) as you
    traversed through the report. How many records are there in the dataset? Is
    the link creating too many records? How about joining the tables together
    into on dataset in order to get the records instead of creating a master
    detail link? What does the resulting SQL look like? Is it what you expect?
    Crtl-mouse click over the dataview to see the magic SQL that is generated on
    the detail dataview.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    Jm,

    In the dataset there are about 30.000 records (the master), in the detail
    there is only 1 reord.
    Probabbly when I post this message i was not wake up enough.
    The solution is simple: as the reports works only for one company, simple
    put the company as master and the second table as the detail, linking the
    second table to the company table through the company code and moving the
    AutoSearch field for the company code to the company table.

    Easy not?

    Regards
    Antonio Budano
    ALTAIR net S.r.l.


  • edited October 2002
    Yes, you've got it. Add a criteria to the master, Company, link in the 1
    record detail and then you should get the small result set that you are
    looking for.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.