Home Devices

Footer in 'child' Subreport

edited February 2016 in Devices
Hello ,

Is it possible to have a 'footer' in a subreport of the kind "Child"?
If not, is there a way to calculate the distance tot the bottom of the page
in a summary band ?


kind regards,

Dirk Janssens

Comments

  • edited February 2016
    Hi Dirk,

    Header and Footer bands are not supported for Child Subreports however
    the main report's footer band will print on all pages whether a
    subreport is being printed or not. RB 17 also introduced the Page
    Summary band which will print a summary band on each page and can be
    aligned to the bottom if needed.

    Below is also a useful article on this topic.

    ------------------------------------------------------------------
    Tech Tip: Subreport header/footer bands do not print for
    Child type subreports.
    ------------------------------------------------------------------

    For a subreport set to pbChild, the header/footer are not supported.
    A child type subreport prints on its parent's page space and
    therefore behaves more like a memo.

    Options:

    1. Use Title/Summary band.

    2. Use GroupHeader/GroupFooter. If you need to repeat the header
    when a page breaks then then you can create a group and
    set Group.ReprintOnSubsequentPage to True.

    Best Regards,

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

    Thanks for your reply, however,

    Option 1 is not a solution, because I allready use that for pagenumbers,
    logo etc...

    Option 2 (groupheader/footer) gives not the good result: it does not come on
    bottom of the page. It comes even higher then the summaty band...

    I also tried the page-summary (RB 17.1), but I cannot set the "align to
    bottom"-property. Maybe because it is in a subreport ?

    Is there maybe a way to calculate the total height of the detail band (it
    uses stretched memo's, so counting is not an option) ?
    That way I could perhaps calculate the top of the labels I want to print
    just above the page-footer.

    kind regards,

    Dirk Janssens.






  • edited February 2016
    Hi Dirk,

    You can use the Report.Engine.PrintPosRect to find the current position
    of a report. Also, you can use the Engine.PageBottom to find the bottom
    of a page and make the proper calculations. See the following article
    on how to fill empty space with lines using these properties.

    http://www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/How_To..._Fill_a_page_with_lines

    Using this to reposition report components may be more difficult than
    expected however. For the Footer band, ReportBuilder allots an amount
    of space before the page is generated so it will fit. In your case, if
    there are enough records to extend the detail the entire page, your
    "subreport footer" will overlap the rest of your report.

    You might consider splitting the footer band into regions and only
    displaying certain regions when the subreport is printing.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2016
    //You might consider splitting the footer band into regions and only
    //displaying certain regions when the subreport is printing.

    Thanks, that sounds good. What would be the best way to know that the report
    is on the last page of that subreport ?

    regards,

    Dirk Janssens.



  • edited February 2016
    Hi Dirk,

    Try using the subreport's summaryband AfterPrint event to determine when
    the subreport ends.

    Another option is to look ahead in your data to determine the final
    record printed in the subreport before it generates.

    Best Regards,

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

    //Try using the subreport's summaryband AfterPrint event to determine when
    the subreport ends.

    I don't understand: In the subreport, I do not "see" the region that is in
    the 'main' report's footer . Only components that are on the subreport
    itself.

    Another problem is : setting the visiblilty of the region, does not clear
    the space that region uses. The footer height cannot be "dynamic" ?
    The footer-bend height is now big on every page. I only need that region on
    the last page of the subreport.

    kind regards,

    Dirk.



  • edited February 2016
    Hi Dirk,

    For future reference please let us know you are using RAP. I was under
    the impression you were using Delphi in which the subreport's events
    would have full access to the main report's controls/bands.

    See the following article on how to access components on a subreport
    from the main report. The same concept applies the other way around.

    http://www.digital-metaphors.com/rbWiki/RAP/Calculations/How_To...Access_Subreport_Values_in_the_Main_Report

    The footer band is static only. If you need a dynamic height band, I
    suggest using the page summary aligned to bottom. You may need to
    experiment with different bands and features of ReportBuilder to get the
    exact output you need.


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.