VCL Report Report Summary

edited 4:07PM in FastReport VCL 5
Hi all,

Hopefully some one can guide me in the right direction - I have a Delivery Advice - It has a Report Title / a Page Header / Master Data and a Report Summary, my issue is that I need to print the Report Summary at the BOTTOM of the last page. there could be 4 rows of data or 40 , all depends on the delivery

I have tried using a Page footer and set it to PrintonLastPage it prints on all pages but the first ? - curious behavior, I'm just not quite sure how to go about achieving the result - Any guidance would be appreciated

Thanks ALL in advance

Trevor Chant

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:07PM
    procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);
    begin
    if engine.freespace > reportsummary1.height then
    begin
    Engine.CurY := Engine.PageHeight -reportsummary1.height -pagefooter1.Height - 1;

    end;
    end;

    OR IF SMMARY BAND IS STRETCHING DO IT HERE

    procedure ReportSummary1OnAfterCalcHeight(Sender: TfrxComponent);

    begin
    Engine.CurY := Engine.PageHeight -reportsummary1.height -pagefooter1.Height - 1;
    end;
  • edited 4:07PM
    tchant wrote: »
    Thanks gordk - that did the trick .

    If I can ask another Question - I have some vertical lines that could also span several pages eg could be 4 rows of data or 40 and span 2 or pages . Which would be the best way to ensure that the lines are drawn correctly eg from the Header to the Report Summary, across 2 to x number of pages

    I had set the double pass to "True" and was using the page number but I didn't have a lot of success, below is what I did , again any suggestions would be much appreciated

    procedure ReportDataOnBeforePrint(Sender: TfrxComponent);
    var lvLineH: Double;
    I,X : Integer;
    begin

    I := Page1.PageCount;
    X := <TotalPages#>;

    if ((I = 1) or (I = X)) then
    begin
    lvLineH := (lvLineH - reportsummary1.height) -1;
    end
    else
    begin
    lvLineH := Engine.PageHeight - Header.Height;
    end;

    Line2.Height := lvLineH ;
    Line13.Height := lvLineH ;
    Line14.Height := lvLineH ;
    Line15.Height := lvLineH ;
    Line16.Height := lvLineH ;
    Line17.Height := lvLineH ;

    end;


    Trevor Chant




  • gordkgordk St.Catherines On. Canada.
    edited 4:07PM
    typically vertical lines can be created in an overlay band they will appear on every output page created.
    tip
    overlay is a bit of a misnomer it is more like an underlay
    create your report first make sure designer is set to use large height in design mode.
    add the overlay band after all other bands or it gets messy designing the page.
    draw your lines in the overlay the top of the overlay is the top of the out put page
  • edited 4:07PM
    gordk wrote: »
    typically vertical lines can be created in an overlay band they will appear on every output page created.
    tip
    overlay is a bit of a misnomer it is more like an underlay
    create your report first make sure designer is set to use large height in design mode.
    add the overlay band after all other bands or it gets messy designing the page.
    draw your lines in the overlay the top of the overlay is the top of the out put page


    I appreciate the help - this is a little new to me and I'm learning - fast - I now have the finished product - great too FastReports !
  • edited 4:07PM
    Hi All,

    gordk kindly showed some code to always position the Report summary at the bottom of a page, I have a question about this if the data stops at less than the Summary.Height and there is only one page of data , I would still like the Summary to be on the bottom of page two, What is happening is the CurY value seems to be at the top of page two - Do I need to add another page ? - The code below is not correct , any help would be appreciated

    if engine.freespace > reportsummary1.height then
    Engine.CurY := Engine.PageHeight - lvBottSpace - 1
    else
    Engine.CurY := (Engine.PageHeight + engine.freespace) - lvBottSpace - 1;

    Regards
  • gordkgordk St.Catherines On. Canada.
    edited 4:07PM
    try using the onaftercalc height event
    procedure ReportSummary1OnAfterCalcHeight(Sender: TfrxComponent);
    begin
    if Engine.FreeSpace < ReportSummary1.Height then Engine.NewPage;
    Engine.CurY := Engine.CurY + Engine.FreeSpace - ReportSummary1.Height - 0.000001;
    end;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.