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

Print Preview problems

edited October 2002 in General
Hello
I'm using Delphi 6 + ReportBuilder 6.03 Enterprise version. I'm loading the
report template from database and trying to print preview the report for a
TQuery with only 2 records. The print preview starts generating 100s of
pages with those 2 records in it until I click on cancel button. Any ideas
why this happens?
Thanks

Comments

  • edited October 2002
    When the template is loaded, are all of the event handlers firing that you
    want connected to this report? Is the datapipeline connected? See the
    templates thread in the tech-tips newsgroup for an article describing lost
    event handlers. You'll need to use the Template.OnLoadEnd event to hook the
    template up to the pipeline and reconnect any event handlers.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    Jim I don't handle any events and the datapipeline is always connected to
    the Report - I just close the Query connected to the pipeline, reassign it's
    SQL property, open the Query, load the template from templates Table and
    call Report's Print method. It gets the first row from the datapipeline and
    loops on it. I have tried to set the datapipeline's RangeEndCount after I
    load the data but useless. Is there anything else I need to do?
    Please advice. Thanks

    Garo


  • edited October 2002
    Call Report.Reset before you run the report again after changing the
    dataset. This will force the report to regenerate for the new data.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    Still no luck. I changed the report properties to load the template from a
    file instead of database but it didn't help as well.

    Garo



  • edited October 2002
    Have a look at an article describing endless pages in the tech-tips
    newsgroup in the general thread. I texplains common ways to get infinite
    pages in RB.

    If the Query -> Datasource -> Pipeline -> Report connections are all good,
    and there are only a few records (as tested by a TDBGrid connected to the
    datasource) then it should print only those records. If you can't get it
    resolved, then can you send us a working example project to
    support@digital-metaphors.com Connect to DBDemos for data so that we can
    run it here without having to use your data.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.