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

Pages not being generated, bands not being printed on blank pages

edited October 2001 in General
I'm generating a report via creating txt files at runtime, then pulling
those into RB. If the user has selected DEFAULT REPORT from a list, I
create a list of records and save them to file then use them.

The first time I generate the report, pages end up missing or blank.
However if I close that report and regenerate it, all the data shows up. I
sometimes also get excetions when switching pages (Next/PriorPage method
calls).

Any ideas?

Comments

  • edited October 2001
    If I run the program on a machine with only 64MB, I get EOutofMemory
    exceptions and the program crashes. Do I perhaps have a memory leak or does
    RB just use a huge amount of memory?


  • edited October 2001
    There is a demo of using the text pipeline in the main reports demo project
    in the RBuilder installation. Make sure to close the newly created text file
    before running the report. Do you have a custom previewer? What if you use
    the standard previewer, do the errors persist?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited October 2001
    RB itself doesn' t use a huge amount of memory. You can run into resource
    issues on Win95/98 machines if you are previewing images/richtext while
    printing them as well. You can run your code theough a memory resource
    watcher to see how badly it is leaking. There was a previewer memory leak
    that was fixed for the RB 6.02 release.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited October 2001
    I am in fact using a custom previewer, however if I use the standard
    previewer I get the same problem. When I generate the report the first
    time, the standard preview window pops up but doesn't show everything
    properly.

    Here's the pattern, nearest I can tell. My report has two subreports. It
    will print the first page of SubRep1 fine, and everything on the second page
    except for the bands. Then it prints the first page of SubRep2 just fine,
    and after that only the bands are not printed.

    Interestingly, if I restart my computer, everything works on the first
    generate but only a few times, at which point it goes back to this problem.
    I'm guessing there is a memory problem and I'm working to resolve that now.
    If this has sparked any more ideas, please let me know!

  • edited October 2001
    I was wrong about it working when I restart the computer.

    However, to add some info, the same thing happens when I print. If I just
    print the report (through code), only certain data appears. However if I
    preview first, then print, it works fine because the report has already been
    generated once. Is there some sort of pre-generate that happens? I notice
    also if I re-generate the report (by pressing enter on the Default Report
    list item again) it goes back to whatever page I was on in the preview, so I
    assume there's some memory carry over or caching going on, because I know
    the .txt files are being regenerated each time.

  • edited October 2001
    Finally, resolution! As it turns out, all the pages of the report were not
    finished generating before I was calling next/prior page. If I wait for the
    report to finish generating, everything works fine. There is still a memory
    issue (due to a lot of images) however it is a seperate issue from this
    thread so I will repost on another thread if necessary.

  • edited October 2001
    I was wrong, I did not solve the problem. This is frustrating and tricky
    because sometimes the report generates and shows the first time, sometimes
    not. If I put two calls to PrintToDevices in then all the pages get shown.
    Why?

    When does AfterReport get called? How do I actually close a report? I
    think I'm leaking memory because I just hide my previewer and then show it
    again upon request. What do I need to call to release the memory used in a
    RB generate? Perhaps this last question should be in a new thread.

This discussion has been closed.