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

Strange problem using subreports

edited August 2003 in General
Hi,

i encountered a strange problem. I have a master and a detail pipeline. In
the report the detail pipeline is assigned to a subreport. The strange thing
is that when the subreport is displayed for the first time, the records in
the subreport are shown corectly(they all print). But if i advance to the
next page and then go back to the first page again, the first record in the
subreport disappears. The interesting thing is that on the second page(and
probbably also on the subsequent - at the moment i don't have enough data to
test), the subreport displays correctly. And even more strange is that if i
close the report (but not the form on which it is located) and call the
print method again (so that the report shows up), the first record in the
subreport on the first page disappears. So, the subreport on the first page
displays correctly only when the report is shown for the first time(since
it's form was created).

I tried to call the First method of the detail pipeline in the master
pipeline's OnTraversal event, but is seems it doesn't help...is it possible
that the first record is skipped in some way???

Any suggestions?

Thanx

Comments

  • edited August 2003
    Hi,

    i have found the problem but it's completely illogical to me. As i said, i
    have a master-detail report (with a master and a detail pipeline). The
    master pipeline has also another detail pipeline - connected to the table of
    customers (the master table is in relationship with the customers table). In
    the report's header (or better in the group header) i print various fields
    from the master table and also some fileds from the customers
    table(pipeline). What i noticed is that the customer's data on the first
    page is displayed only when the report is displayed for the first time. If i
    advance to the second page(where customer's data is always correctly
    displayed) and then back to the first, the customer's data isn't displayed
    any more. Why??? Btw, the fields for customer's data are directly dropped
    from the data tree (they are not calculated or somehow changed in any way).

    The funny thing is that if i remove all the fields that belong to the
    customer pipeline from the group's header, the subreport displays all the
    records correctly (but of course, i dont have any customer's data in the
    header)....

    I realy don't know why of this strange behaviour.

    Any suggestion on how to fix that or is it better if i delete comletely the
    customer pipeline and execute a query every time it's necessary to refresh
    the customer's data?
  • edited September 2003
    Hi Jure,

    Try setting the Report.CachePages property to True and see if that helps.
    This will save the exact format of each page as you view them the first
    time, preventing changes as you move forward and backward through the pages
    of your report.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2003
    Hi Nico,

    i read what is written in the help about the CachePages poperty and i
    noticed that using it, would solve many problems that i had in the past.
    e.g., when i made custom calculations (in delphi) i had to check if the page
    was already displayed - otherwise i'd make the calculations many times.

    If it's possible, i'd like only that you say if the next statement is
    correct:
    If the CachePages is set to true and the report PassSetting is twoPass, the
    whole report is actually created in the first pass (i wonder about the page
    numbers?...) and i don't have to check if a page is displayed more times to
    have the calculations correct.


    Btw, i also read that this approach it memory-consuming. Do you know about
    how much space takes a single page(or better: for a report of how many pages
    is it good to use that approach - on a computer with 256M of memory)?

    Thanx
  • edited September 2003
    Hi,

    When a Report.PassSetting is set to psTwoPass, the first pass is only to
    calculate pagination. No actual pages are received or DrawCommands are
    created until the second pass. So when using CachePages and a two pass
    report, you are not using any more memory at once than a one pass report.

    The memory taken by each page can vary depending on the objects displayed.
    A page full of text will take up a lot less memory than a page with five
    500K bitmaps. Remember when using the CachePages property, all pages are
    saved to memory when they are generated. If you would like to see if your
    machine is able to handle the report, run the Windows task manager in the
    background while you execute the report and keep track of the resources
    being used as you scan through each page.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.