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

How to stop printing blank pages?

edited March 2003 in General
Am sure I have seen this topic before, but cannot find it!

There are a number of instances where Rb is unable to print because
something in the report appears to go over the page boundaries.

In some instances, I am only expecting RB to print one page... how can I get
the report to abort (in RAP) if attempting to print more than x pages?

I think one of the causes of the above problem is font substitution when the
specified font is not installed (e.g. when trying to run a report on a
number of different PCs.

Is there any way RB (or I, in RAP?) can check that all the fonts specified
in the report template are actually installed before running the report,
instead of just substituting a font? This would save me a lot of support
calls concerning template portability!

Regards,

Pete Colson

Comments

  • edited March 2003
    Do you know why you are getting infinite pages? If a band or control can't
    fit on any page, then that would cause it. One way to try to code a check
    for infinite pages may be to check to see during the detail band after print
    events, if the detail band is OutOfSpace more than two times consecutively.
    This would mean that at the bottom of a page, it couldn't fit, and also at
    the top of the next page, it couldn't fit on the page.

    To find out the fonts which are installed, you have to use some Win API
    calls. We have done this already. Look in ppUtils.pas for the TppFontList
    class. It can get a list of the fonts. This is what we use in the report
    designer to show the fonts available to design the report with.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    I think the problem is almost certainly as you described ... controls not
    fitting onto a page ...

    Having got a template working here OK and shipped to other users, they
    sometimes have problems printing, especially with templates which have
    Regions that are positioned in RAP to fit onto a particular label on an A4
    sheet (the region is only small). I think it's because either the user is
    missing some of the fonts specified in the template (and Windows substitutes
    it with a font that overflows the region or page), or because their target
    printer has larger unprintable page margins.

    I was hoping to find something simple e.g. if page count > 1 then abort the
    report, but will try what you suggested anyway.

    Have managed to get a list of available fonts (Printer.Fonts) and, having
    loaded a template, am now scanning through all the bands and components and
    checking for fonts that are not in the list.It works well, except for draw
    items (lines, shapes etc) which RB sets to MS Sans Serif - which is not
    installed on my development PC. I don't want to display a warning message
    for a missing font if it's not actually used but have not found a component
    property that I can check to see if the font is needed (e.g. is it a text
    object or a draw object? ). Any pointers you can give me on this would be
    much appreciated...

    Regards,

    Pete Colson



  • edited March 2003
    The easiest this to do is to try increasing the margins for the report to
    account for the printers that your users have which require larger margins.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.