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

Subreport reprinting

edited September 2003 in Subreports
I have a subreport that whenever it is at the bottom of a page it reprints
on the top of the next page. It can do it in two fashions.

1.

Header Info
Detail Info 1
Detail Info 2

Then on the top of the next page it will be repeated

Header Info
Detail Info 1
Detail Info 2

And sometimes, it will only reprint the header even though there is nothing
underneath it such as

Header Info
Detail Info 1
Detail Info 2

and on the top of the next page

Header Info

Next Header Info
Next Detail Info , etc

Is this the results of some kind of setting I can change? Or does anyone
know what causes this?

Thanks

Comments

  • edited September 2003
    Hi Chris,

    Only section style subreports generate headers. What is the
    Subreport.PrintBehavior property set to? If it is section style, then this
    style of subreport always prints on a new page when it gets a chance to
    print.

    What version of RB are you using? Can you reproduce this scenario with our
    demo reports with subreports? If you can reproduce this with RB 7.03, then
    can you send an example that shows the problem to
    support@digital-metaphors.com and we'll research the issue.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    the section style of the subreport both the detail and the header are
    pbChild.

    I am using 6.03.

    I am not sure if i can recreate this in 7.03 because i didnt' write this and
    the guy who did took a couple months to get it done.

    Is there any other settings I can check?

  • edited September 2003
    I have also noticed that this appears to be only at the bottom of the first
    page and top of the second

  • edited September 2003
    Hi Chris,

    This sounds like a bug we fixed in RB 7. Can you download the trial edition
    of RB 7.03 from our website www.digital-metaphors.com and try to reproduce
    the problem using the latest version? The trial's page limit is 5 so you'll
    have to change the data so that the subreport ends up on the bottom of the
    page on the first 4 pages or so to reproduce the error.

    Is there any code that is changing the subreport visibility? Have you
    disconnected any event handlers that are doing this to see when the problem
    goes away? Perhaps an event is firing twice when the code is assuming it
    fires only once?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    How do i get rid of dadataman.dcu errors and dadatamodule.dcu errors when I
    compile in 7.03 rather then 6.03

    thanks.

  • edited September 2003
    Hi Chris,

    I meant that you should evaluate RB 7.03 trial edition to see if upgrading
    to RB 7.03 would fix your problem. Don't try to mix dcu's from one version
    to the next in RB as they aren't compatible. If that isn't the case, then
    make sure your library path is pointing to the newly installed RB 7.03 trial
    edition's RBuilder\Lib directory and not to older installation paths of RB.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    I didn't mix dcu's I just installed the trial version. And the program will
    not compile because it is missing DCUs dadataman and dadatamodule.

    I'm fairly certain it is pointing at the 7.03 lib directory.

  • edited September 2003
    Which version did you download? Those are dcus that are only included in the
    Professional and Enterprise editions. If you downloaded RB Standard then you
    won't have those dcu's available to run an end user application you created
    in RB 6.03 Pro/Ent. We've tested the demo installs and they should have the
    correct dcus.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    ok now i just need to get rid of the error that zsPagewidth and zsWholepage
    are undeclared identifiers? How do i get rid of this, what changed.

  • edited September 2003
    Hi Chris,

    Those errors are caused by ppTypes missing from the uses clause. In order to
    add new features to RB 7 we had to remove those types from ppViewr.pas.

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    Ok that fixed that error.

    And the demo does not have the inital error in it. It seems to print just
    fine. I guess its time to upgrade.

  • edited September 2003
    I was wrong that didn't fix the error. Its still happening in 7.03 seems to
    only be on the first page, any help please?

  • edited September 2003
    Can you send us a minimal example that reproduces the problem. This is the
    only way we can debug and fix an error either if it is in your code or in
    our code. A demo would be the fastest way for us to solve the problem.
    Please send all attachements to support@digital-metaphors.com and we'll be
    happy to dig into it.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    hmm this is very complex report and i'm sure the complexity is what causse
    the issue. You don't by chance want to like VNC into the computer and see
    it in action do you?

  • edited September 2003
    A new piece of information.

    After teh first page finishes. I put a stop on the onnewpage event and look
    at what record it was on. It was on the next subreports record. Which
    means that the repeated subreport that appears at the top of the page isn't
    even generated during the 2nd page it is just put there at the start of the
    page. Almost as if their is a printing buffer that needs to be cleared on
    new page so that whatever the last then sent to the page can be erased so
    that it is not accidentally reprtinted on teh new page. Can i do anything
    like this manually?

  • edited September 2003
    I just emailed you with an example of the issue.

    Thanks.

  • edited September 2003
    Hi Chris,

    We received your demo. The problem is that the report is two pass and the
    pagination of the first page changes as a result of the code you have in the
    report during the first pass. The pagination can't be different for each
    pass. There is a lot of code in this report and you'll have to initialize
    the report's first page so that it will paginate the same when the first
    page is paginated in the first pass and when it is generated in the second
    pass. There is probably some code that you have that is in the before print
    of the top most group header. I see that when I run your report, the whole
    first page shifts up, like there is a ShiftRelativeTo action that is
    happening or there is code that repositions one of the shift relative to
    components upwards. You'll have to isolate where the code is, but if you can
    get your events handlers to evalutate with the same values, ie, all
    components that are visible have the same visibility and position in th
    first apss as they do in the second pass. You could also write code to
    initialize the report again at the start of the second pass so that it will
    paginate using the same baseline state as it did when it started the first
    pass. That may be a better way to think about the problem.

    One other quick workaround solution is to change the Report.PassSetting to
    psOnePass and set Report.CachePages to true. Doing this will cause the total
    page numbering to be incremental as the report is being previewed while the
    pages are being generated for the first time.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    Okay. I will look at what I can do about these things.

    Regarding your quick fix. It works for the print preview, but if you print
    it it does the same old double print thing again. Is there a quick fix for
    the print part too?

  • edited September 2003
    The problem is the pagination changes because your code is manipulating the
    layout when it runs. You'll have to reload the report template to
    reinitialize the footprint of the report so that your code can run the same
    for each pass of the report. The report is regenerated to the printer, so in
    effect it is doing the same thing as a second pass would because the report
    layout is in the state your preview generation's event handlers left the
    report. For example, when your preview the report to the screen and in the
    very last detail band before print event handler you set the detail band
    label's color to red, then when you print the report to the printer, the
    first detail band label will print with the color red, well only if the
    pages aren't cached for that specific printer that is.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2003
    Thank you very much. I got it working.


  • edited May 2004
    I am having the same problem also and I was wondering if it would fox my
    problem. When is Report Builder going to do a general release of 7.03?
  • edited May 2004
    Hello,

    Version 7.03 is the current release of ReportBuilder. We released this
    version 08/23/2003. Please contact sales@digital-metaphors.com for more
    information on updating.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004
    Thanks Nick. We were able to get version 7.03 but unfortunatley the report
    is still behaving incorrectly. I am attaching you the report document so
    that you can look at page 2 and page 3 of this sample document. You will
    notice that the subreport at the bottom of the page 1 gets repeated again on
    page 2. I was hoping that 7.03 would fix it. Is there a way to fix it?

    In the past we were told to fix this issue we should use database component
    for each and every query component that we have in the report. That seems to
    work but the only issue with that is it slows down the report because
    everytime we try and print this report it makes those database connections
    first before printing the report.

    So after we got upgraded to 7.03 I took out all the database components but
    this report came back with the sold issue. Can you suggest something that
    would fix this problem? We really do not want to make multiple database
    connection to fix this issue.

    Thanks
    Sujas

  • edited May 2004
    Hi Sujas,

    As a test, try commenting out your event handler code and see if that fixes
    the issue. If it does, periodically begin adding the code back to isolate
    the problem. If you still experience the problem, please send a simple
    example demonstrating the problem in .zip format to
    support@digital-metaphors.com and I'll take a look at it for you.

    --
    Best Regards,

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