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

Form Emmulation

edited February 2003 in General
This has already been posted under subreports but I had no response.
Sorry about the cross-posting.

I have built a classic Purchase Order for our application. The main report
holds the header information (Address, Account Number, etc.). A sub-report
holds the lines of the Purchase Order (Item, Price, etc.).
The box around the sub-report needs to go to the bottom of the page
regardless of the length in the subreport. I'm finding this tricky to do.
Any ideas?
Regards,

Nick White

Comments

  • edited February 2003
    Did you try using a PageStyle band? (Report/PageStyle). set it to the height
    of the printed page minus the margins.

    --
    Ed Dressel
    Team DM
  • edited February 2003
    > This has already been posted under subreports but I had no response.

    Nick, you posted at 1 *AM*, when most of us in the US are sleeping (where DM
    is located). Maybe next time wait until a few of us are awake before cross
    posting.

    Thanks
    Ed Dressel
  • edited February 2003
    If I place a line in the page style band this is superimposed by any data
    from the report i.e. the part of the report I'm trying to format covers up
    the formatting lines in the page style band. Can you set the page style to
    'bring to front' the shapes and lines you place there?

    Sorry again about the impatient cross posting Ed.

    TIA

    Nick

  • edited February 2003
    BringToFront on the PageStyle is a feature which has not been implemented.

    You will have to add the draw commands in the OnEndPage event as a
    workaround. Here is an example which adds a draw command 'box" to every page
    as if were on the top of all the other draw commands:

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


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited February 2003
    Thanks for the example Jim. Unfortunately I'm more of an 'end-user' than a
    Delphi programmer. Is there any chance of an example I can view with Report
    Builder itself.

    I've actually managed to create a Report that (almost!) works by using a
    Page Style section. Unfortunately when the records in my sub-report strech
    over a single page the report creates a blank page 1 for some reason. I can
    avoid this though by setting the Page Style section is set to
    DynamicHeight - the report then runs perfectly. However when I return to the
    Design tab the Page Style section has set itself back to Static Height.
    Is there any way I can stop it from doing this?

    Thanks in Advance,

    Nick W


  • edited February 2003
    The PageStyle band will always set itself to be static height. It is a bug
    if you can set it to dynamic height. Thanks for reporting this issue.

    FYI- These newsgroups are specifically for the use of our direct customers
    who purchased a license to RB or are evaluating RB before purchasing.

    You'll have to ask your developer to include a RAP pass through function so
    that you can get to this code with a one line call in the Calc tab (if you
    have RB Enterprise Edition). The code you will end up calling is in the RAP
    (Report Application Pascal or our native runtime interpreter)
    Report.OnEndPage event
    CreateBoxFunc(Report);

    Are you familiar with the 'Calc' tab in the report designer? You may or may
    not have this as the option is up to the developer+your requirements. If you
    want to create a box as the last draw command on top of all the others on
    the page, then your developer will have to include this code below in a pass
    through function, where the aReport is the report parameter passed in the
    pass through function call. Tell your developer to research RAP pass through
    functions in our installed RAP demos directory and have them redistribute a
    new installation with this capability. With RAP, you can ask your developer
    to provide almost any kind of function and provide it to you in RAP. RAP is
    extensible by the developer, and you can use it to create your own event
    handlers in the report to control the report components/output as the report
    is generating.

    uses
    ExtrCtrls, ppDrwCmd;
    ...
    var
    lShape: TppDrawShape;
    begin

    lShape := TppDrawShape.Create(nil);
    lShape.Page := aReport.Engine.Page;
    lShape.ShapeType := stRectangle;
    lShape.Top := aReport.PrinterSetup.PageDef.mmMarginTop;
    lShape.Left := aReport.PrinterSetup.PageDef.mmMarginLeft;
    lShape.Width := aReport.PrinterSetup.PageDef.mmPrintableWidth;
    lShape.Height := aReport.PrinterSetup.PageDef.mmPrintableHeight;
    lShape.Pen.Color := clBlack;
    lShape.Pen.Width := 6;
    lShape.Pen.Style := psSolid;
    lShape.Brush.Style := bsClear;


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.