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

pagestyle and margins

edited August 2003 in General
Hi there,

I am building something that would exports reports as an PDF file
however, Official paper would be very nice, with company logo and all.

Now is it so that often that sort of things (logos/text) goes outside of the
printable area for a printer.

If I add an pagestyle band to the report you can't exceed the papersize
minus margins.

is there any way to bypass this, so I can add a non-margin pagestyle add it
programmically to other margin-based reports but the pagestyle ignores the
margins ?

Paul

Comments

  • edited August 2003
    Hi Paul,

    This is possible to do by creating a draw command in code and placing it in
    the page style where ever you would like. The link below gives a good
    example of how this can be done. In the example I first create a
    TppDrawCommand that displays a blue rectangle. Then to get the rectangle to
    print in the proper order (ie. page style objects always print first), I
    extract all TppDrawCommands and temporarily place them in a TList. Finally
    I assign all the drawcommands back to the report using another loop. Hope
    this helps.

    http://www.digital-metaphors.com/tips/AddDrawCommandPageStyle.zip

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2003
    not exactly what I was looking for.

    is it possible to add a property in the pagestyl band that says 'Ignore
    margins'
    which effectivly removes the marginleft & margintop from the left & top of
    the printed object

    So we can make an pagestyle, and then copy the objects one by one as given
    in an earlier example. Or a way to load a pagestyle into a report from a
    file/database that does effectively the same.

    Cheers,

    Paul Menheere

  • edited August 2003
    The pagestyle prints behind the other bands. It still generates draw
    commands to the same page object that the other bands generate draw commands
    for. In the report layout, each page can only have one printer setup. There
    is an unprintable area that each printer has. This is the smallest margin
    that you can specify on the report. If you want to use larger margins for
    the layout but use the max space for the page style, then you could shift
    the components in the report to appear to have more space to the left and
    right of them rather than relying on the actual margins defined for the
    report which limits the band space available when designing the report. This
    would be the only other way to accomplish this in the layout without
    manipulating the draw commands generated on the page. One other change you
    could make would be to hook into the draw commands created by the page style
    components (OnDrawCommandCreate events) in order to use the demo to
    "stretch" the draw commands to occupy the available space that is really on
    the printer. This way you could still define larger margins in the report
    layout and then be able to have a pagestyle somewhat defined in the layout.
    Then when you generate, the page style draw commands stretch so that the
    report appears the way that you want it to.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.