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

Setting group header height in RAP

edited March 2013 in RAP
Hi,

using last RB in Delphi 2010. I have report with 1 group. Detail can
spawn over more pages within same group. I'm trying to change in RAP
group header height where page no >1.
My idea is to set group header to be printed on every page, but only
first page of group will have full height. Other will be smaller.
But it doesn't work. Any ideas?

Regards, Tone

Comments

  • edited March 2013
    Hi Tone,

    Which event are you using to alter the header band height. You need to
    be sure you use an event that fires early enough so the engine can make
    the changes needed. I suggest trying the OnStartPage event.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2013
    Hi,

    from my last post I changed report design. Now I'm trying to accomplish
    same thing but with changing page top margin. I want that first page has
    top margin 10, any next one top margin 30.
    I put this code in reports onStartPage event (RAP):

    if Report.Page.PageNo = 1 then
    Report.PrinterSetup.MarginTop:=10
    else
    Report.PrinterSetup.MarginTop:=30;

    But this MarginTop gets applied to late.
    In preview (2 pages), first page has margin 10, when I go to next page,
    margin is still 10, but when I go back to first page margin 30 is applied.

    Report has group header on, that is set to reset page count.

    Any ideas?

    Regards, Tone


  • edited March 2013
    Hi Tone,

    By the time the OnStartPage event fires, the PrinterSetup information
    has already been passed to the page object so you would need to access
    that in order to alter the Margins.

    In Delphi it would look like this...

    if Report.AbsolutePageNo = 1 then
    Report.Engine.Page.PrinterSetup.MarginTop := 10
    else
    Report.Engine.Page.PrinterSetup.MartinTop := 30;

    The engine is not natively included in RAP so you would need to create a
    pass thru function in order to access it. See the RAP demos on how to
    create a pass thru function for RAP.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2013
    Thank you. I will try that and report my success, problems.

    Regards, Tone

This discussion has been closed.