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

report running slow

edited June 2003 in General
I am using RB 6.2 with D5 and ADS 6.2. I have a report the customers are
complaining is taking a really long time to display. To go from one page of
the report to the next the customers are stating its taking from 15sec to
2.5 minutes. One is even stating as he goes through the report it takes
longer and longer with each page. I'm not really sure where to even begin
looking.

Any help is appreciated, Thanks in advance,
Rodger

Comments

  • edited June 2003
    How is your data access configured? Are you using parameterized detail
    queries? How many event handlers are part of this report? Is there a speed
    issue on a simple table dump report with one dataset? Is there a slow
    network connection to the Advantage server? Are you using DADE for data
    access? If so, then this should be faster for linked datasets in comparison
    to trying to parameterize detail queries. This is problably the cause. You
    can link pipelines in RB Standard. Which version of RB are you using? You
    should order the detail dataset by the master and have the detail dataset
    return all detail records for all masters in the proper order. Then you can
    set the two pipeline linking properties to tell the report engine that you
    have prepared the detail dataset for a fast master detail configuration and
    you won't have to use parameterized detail queries (which are slow).


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited June 2003
    I think you lost me.

    I am running Master detail queries. They are parameterized queries. I am
    running 6.2 waiting for my order for 7 to go through. I'm using a local
    server on most customers machines. I'm not using DADE (at least not that
    I'm aware of). Is there an example of linking the pipelines? I have a
    before print event handler on the TppReport component and also one on the
    OnPrint for the TppRichText component.

    I think that was all the questions you asked.

    Rodger

  • edited June 2003
    Yes, the reason the report is slow is because every time the detail band of
    the master report fires the event, it fires a detail query. The event can
    fire multiple times when a page break occurs, thus slowing this down even
    more by your code firing the same event more often than the record count
    implies.

    So, a solution is to fire one query which returns all details for all
    masters. This is what we do in DADE and for almost all cases it is MUCH
    faster than the Delphi way of linking datasets because there is only one
    query to get the detail records. Basically, make sure the detail dataset is
    ordered by the master, meaning you may have to join the master table to the
    detail table in the detail dataset to be able to apply the appropriate ORDER
    BY in the detail dataset.

    Here is an example in which DADE was used to generate the SQL which is then
    copied to two TQueries on a form for demo purposes. You don't need RB
    Professional to run this demo, simply remove the da* units from the uses
    clause that cause compile problems.
    http://www.digital-metaphors.com/tips/MagicMasterDetail.zip


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited June 2003
    When I try to change the Database settings all I get for choices are ADO,
    BDE, and IPX nothing for ADS. Am I doing this right?

    thanks,
    Rodger

  • edited June 2003
    Well I figured out how to get the Advantage access installed. But now every
    time I try to run the Query Wizard or Query Designer I get an error that
    states I need to put in a connection string first. but I already put a
    connection path into my TAdsConnection Component. Why am I still getting
    this error?

    thanks in advance,
    Rodger


  • edited June 2003
    Well I fixed the connection string problem by creating a Alias to my
    database. but when I open the query wizard or designer it lists no tables.
    What am I missing?

    thanks in advance,
    Rodger


  • edited June 2003
    The advantage alias approach should work with the ADS DADE plugin. It works
    for us here. Verify that the alias can be used to fire an ADS query at
    runtime to get data to a simple dbGrid on a TForm. Set
    Designer.AllowDataSettingsChange = true and check the settings at runtime to
    be sure they are configured correctly while at rutime. Maybe it is getting
    cleared out?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited June 2003
    Jim,

    I managed to figure out what I was doing wrong and got the DADE pluging to
    work properly.

    When I run my report only 1 detail band gets displayed. I have been all
    through this report and I'm just not finding it. According to my detail
    TAdsQuery component its returning 1300+ records which is about right, but
    only is displayed. Any thoughts or suggestions I can check?

    Thanks in advance,
    Rodger


  • edited June 2003


    According to my detail TAdsQuery component its returning 1300+ records which
    is about right, but
    only one band is displayed.


  • edited July 2003
    Make sure the report is connceted to the data. From the Report menu, there
    should be a Data menu item that lets you select the dataview's pipeline from
    a drop down. This is most likely the culprit.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.