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

Will preview but not print

edited April 2003 in General
I have a report that runs fine in preview, but when i try to print it from
the preview screen blank paper comes out of the printer. Did i turn
something off by mistake?

Comments

  • edited April 2003
    Try setting Report.CachePages to true. What may be happening is that your
    event handlers are refiring, as they always do when generating for the
    printer unless CachePages is set to true after a screen preview of the
    report. Are you event handlers prepared for this? You may have to
    reinitialize delphi variables that you are using before the report prints to
    any device.

    Disconnect your event handlers for the report until the problem goes away.
    This way you'll be able to isolate what piece of the puzzle is affecting the
    data or the report band visibilties if you are setting those.

    Another test is to simply connect a repot to the data pipeline and create a
    main report using the report wizard and print that to the printer without
    any code other than a Report.Print call. This will tell you that you can
    indeed print a report using this data in a simple test.

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    The cachpages= true didn't fix it. I have trace thru the code and it does
    hit eveything a second time when i hit print from the preview screen. When
    the black page comes out of the printer, at least my headings and text boxes
    should appear if there is no data, or the no data found message should
    appear.

  • edited April 2003
    actually it is not hitting the detailbandbeforeprint when you click to print
    from the preview screen but it hit this procedure on preview.

  • edited April 2003
    why would this only hit the detailbandbefore print on the first iteration,
    be it print or preview and not hit the detailbandbefore print on the second
    interation? It does hit the report.before print on both iterations. i
    still think that something somewhere got turned off that should be turned on
    but i can't find anything different from a report that works correctly.

  • edited April 2003
    It should refire. It sounds as if the event handler was disconnected. Are
    you loading a template? After you load the template, make sure you reconnect
    the event handler. Please see the Tech-Tips newsgroup in the Templates
    thread for an article describing how you can get in a situaiton where an
    event handler is 'lost'.

    Can you reproduce the problem using our installed demo reports? Can you send
    a simple zipped Delphi project to support@digital-metaphors.com that shows
    the problem?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    If the event handler was disconnected why does it run ok on the first
    time(ex: print or preview) and not the print from the preview screen? We
    are using templates and the templates and the event handler s work fine
    when the report is called to preview or print. I checked your tech notes ,
    the situation where the event handler will get lost was never executed,
    meaning i never change the name of the report component.


  • edited April 2003
    Please send a small simple zipped demo to support@digital-metaphors.com that
    shows the problem.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.