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

Problems with Second-Pass run...

edited November 2001 in General
I found a rather strange thing. I have two data pipelines, which are using
the connection feature to bind these two together. The first one populates
the main report and the second a sub-report. It works fine when I do a
single pass run, but as soon I use a two pass, I see the right data the
first time and then most of it vanishes in the second pass (there were 14
entries before, only one after). Also, if I don't use the cache, even with
single pass, going to the next page and then back gives me completely
different results on the prior page.

As I use a custom dataset I can't say for sure if this is a problem with my
dataset or ReportBuilder. I tried to run the same query that ReportBuilder
is using and then just do a "First" after the dataset has finished
enumerating the records and compare the result. They are the same. How does
ReportBuilder reset the data pipeline after the first pass? Or are there any
other hints how to track this down?

Regards, Marco...

-------------------------------------------------------------------
Marco Heine
QUMAS
Enterprise Compliance Management
Visit our Website: www.qumas.com

Comments

  • edited November 2001
    Hi Marco,

    is there any data-manipulation in your code? - If so, avoid it.

    regards,
    Chris Ueberall;

    my
    does
    any
  • edited November 2001
    I tried to bring it down to the most simplistic case, and even then this
    happens. There are only three tables involved (one for the main report and
    two for the sub-reports) and no data is manipulated from code. I want to use
    a order clause later on though. Is there a way to set the autosearchfields
    for the second query from the RAP code so the query re-runs on every
    sub-report occurrence (doing the link manually from within the code)? I
    played around with it, but it seems that changes to the autosearchfields are
    ignored as soon the report started.

    Regards, Marco...
    -------------------------------------------------------------------
    Marco Heine
    QUMAS
    Enterprise Compliance Management
    Visit our Website: www.qumas.com

  • edited November 2001
    I investigated a bit further, though without much success. I found out, that
    if I put the same data into the detail band of the main report, it will
    display correctly (obviously only the first row of the second dataset). I
    hid the sub-report in this case and I was able to navigate the pages without
    visible data-change on the report. I then made the sub-report visible again
    and both, the data in the sub-report plus the data that I put from the
    sub-reports data-pipeline into the main-report disappeared. It looks to me,
    as if ReportBuilder looses track of where the sub-report's data is. Another
    funny thing is, if I add any order clause to the main-query, the first page
    displays correctly after the second pass, till I navigate forward and back.
    Then the data of the sub-report has vanished as well. The RB Source is a bit
    hard to follow, due to is OO nature, so I wasn't able to track this down.

    Any other ideas how to fix it? Right now I'm thinking of creating my own
    Print Setup-Form, running the report once in the same paper-format the user
    has selected on screen (to get the page count) and print it then as a
    one-pass, setting the AbsolutPageCount manually (which works).

    Regards, Marco...
    -------------------------------------------------------------------
    Marco Heine
    QUMAS
    Enterprise Compliance Management
    Visit our Website: www.qumas.com

  • edited November 2001
    Hi Marco,

    You could create a simple demo that shows your problem and send it to
    support, if possible.

    Cheers,
    Chris Ueberall;

  • edited November 2001
    Your dataset must provide TDataset functionality and it has to support
    bookmarks. RB supports connections to TDataset descendents. RB will
    traverse the records automatically by calling the TDataset methods. RB
    datapipelines use bookmarks on the dataset. Yep, the datapipeline could get
    out of sync if you are moving the current record pointer around while the
    report is running. When the first pass ends, and the second pass starts,
    the report engine will try to restore the bookmarks, and calling First on
    your dataset isn't going to be enough for the report engine to get ready for
    the second pass.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited November 2001
    Hi Jim...

    I spend almost two days on this problem and I finally found it :) After
    "fine-tuning" my bookmark-code, I still had this problem. I testet the
    component by jumping randomly all over the table and it worked, but I still
    had the same problem in RB.

    Here is what happend: RB calls the "GetBookmark" function. I did not set the
    protected BookmarkSize property of the TDataSet. That caused the memory
    allocation for the bookmark to fail and returned "nil". After setting this
    variable to the correct size, it works without a hitch.

    Thanks for your support,
    Marco... :)
    -------------------------------------------------------------------
    Marco Heine
    QUMAS
    Enterprise Compliance Management
    Visit our Website: www.qumas.com

This discussion has been closed.