none
Absolutely page-bottom alignment on "report footer": Impossible?

    Question

  • Relative newb to SSRS here, but the answer to this question evades me; answers and insight are appreciated.

    Report in question is an invoice form. It requires an absolutely bottom-of-page aligned footer that has databound elements.

    This is so that whatever page that footer finally appears on will print in such a way that the address will align in a windowed envelope.

    Ironically, Books Online gives this exact scenario in explaining headers and footers in SSRS, but they cleverly don't explain how an absolutely bottom-of-page-aligned and data-bound footer can be made to happen. Headers at absolute page top is obviously no problem. Footers at page bottom, not so much.

    So, this is not a "page footer"--page footers are employed in the body. Also this footer is databound, so a page footer as it's known in SSRS is out the window anyway.

    Most of the time this will print on a single page, but if it breaks to multiple pages, that footer needs to go all the way to the absolute bottom.

    I grasp that the "report footer" for SSRS is just what appears at the end of any repeating controls that you've implemented in your body. Because SSRS uses this kind of repeating-control based idiom rather than a section-based idiom as Crystal does, this kind of (what I would consider very basic) positioning control is looking fairly impossible right now.

    Among what I've tried:

    --Page footer (can't; databound)

    --Specifying a page break after the pre-footer controls, and/or a page break before the controls that make up the footer in their properties. This leads to unpredictable results with blank printed pages (as many as 8 for what previews as a 2-page report, how silly is that?).

    --Putting in a page-height rectangle as part of the footer (with and without the page breaks mentioned above), with the idea of forcing a basically blank page at the end of the report so that the footer will go to the bottom. SSRS will go ahead and break the page anyway on long elements like that, which again leads to the "footer" being printed in the middle or top of the final page, or whereever it happens to fall.

    I may be having to explain to my client that you can't get there from here, and they may have to redesign their report. Does anyone have any insight?

    Thank you for your time in reading this.

     

    Wednesday, March 21, 2007 6:11 PM

Answers

  • I too have a business requirement to put 'footers at the bottom' and have found (like a lot of others here) that SSRS doesn't make this easy using the built-in footer section. The real show stopper is that once you declare the size of the footer section at design time, that's what you get on each and every page.

     

    The breakthrough for me was to recognize that footers as I needed them are really report content. When I took that approach, it became a solvable problem involving three items: the preceding content, the offset, and the notes (as I call them so as not to be confused with SSRS footers).

     

    The offset is implemented as a subreport that has an invisible, variable length table. The length of the table is determined by a parameter, cleverly called the 'offset'. The invisible table acts as filler between the preceding content and the notes so that the notes are bottom justified.

     

    The report gets the offset parameter by calling into business logic that uses:

    • the data for the preceding content,
    • the data for the notes content,
    • the page layout, and
    • the starting position of the preceding content

    to calculate the table length so that the notes are bottom justified.

     

    Monday, September 24, 2007 4:07 PM

All replies

  • Hi there Matty,

    I  think i got the idea that you want to print out the address of the customer at the bottom of the page (ideally the report page footer) but it won't allow you to have any databound values because the databound values are only for the body right ?

    If that is the case, there is a common way to get around this.

    This is what I do and it does work. Make a couple of textboxes (tb1 and tb2) in the Body of the report. Set the Hidden properties to True for the textboxes.

    Next, drag or code into the tb1 and tb2 the dataset values; Name or address or whatever.

    In the report footer or page footer, Set your textboxes and named them tbName and tbAddress.

    in the expression builder for tbname, put this "=ReportItems!tb1.value" and in tbAddress put "=ReportItems!tb2.value"

    When you run the report, tb1 and tb2 will be invisible (you can even send them to the back, hiding behind the table or something, but always make sure that the Hidden property = true).  yet your page footer should have the values assigned to them.

    I hope this helps and is according to what you are trying to describe.

    Bernard Ong

     

    • Proposed as answer by TonyDing Wednesday, August 18, 2010 9:20 AM
    Wednesday, March 21, 2007 8:14 PM
  • Kind of. The method you describe is pretty much what Books Online says about it. Key to the problem here is that this footer should only appear on the last page, which you get around by examining the page number using hidden fields as you describe, then making it visible as needed.

    Problem is, though, that SSRS appears to 'reserve' the space for the header or footer whether it's visible or not, or you've specified Print On Last Page/First Page or not. It just doesn't render elements in that region but it does save the space.

    This particular "footer" is literally 1/3 of a portrait page, so I can't have that kind of blank space being held on pages where it's not in use. I've also noticed issues in preview when you have invisible elements in use; although it'll print OK, the display is wildly off.

    Very much appreciate your response, though. If you had a workaround up your sleeve for these additional issues with that method, then I'd be golden! :D

    Wednesday, March 21, 2007 9:09 PM
  • As you said, set PrintOnLastPage=true for page footer and then use top padding to print it at the bottom of the page. You can also use expression to set the passing.

    Shyam

    Thursday, March 22, 2007 5:25 AM
  • Thank you, but unfortunately that also does not address the space reservation noted above that is critical to this particular use case. Use of the page footer here as the report footer denies it from a differently-formatted use in the report body when it spans pages, and it also causes the space to be reserved on the body pages; this particular report cannot use just 2/3s of the page on every page besides the last one.
    Thursday, March 22, 2007 10:08 PM
  • I too have a business requirement to put 'footers at the bottom' and have found (like a lot of others here) that SSRS doesn't make this easy using the built-in footer section. The real show stopper is that once you declare the size of the footer section at design time, that's what you get on each and every page.

     

    The breakthrough for me was to recognize that footers as I needed them are really report content. When I took that approach, it became a solvable problem involving three items: the preceding content, the offset, and the notes (as I call them so as not to be confused with SSRS footers).

     

    The offset is implemented as a subreport that has an invisible, variable length table. The length of the table is determined by a parameter, cleverly called the 'offset'. The invisible table acts as filler between the preceding content and the notes so that the notes are bottom justified.

     

    The report gets the offset parameter by calling into business logic that uses:

    • the data for the preceding content,
    • the data for the notes content,
    • the page layout, and
    • the starting position of the preceding content

    to calculate the table length so that the notes are bottom justified.

     

    Monday, September 24, 2007 4:07 PM
  • @ tnx1, I tried inserting a sub-report with an empty table. But I didn't totally get your point when it comes to passing the "length of the table" as parameter. I defined a parameter for the sub-report, but how exactly do you pass the parameter from a report to a sub-report? I was trying to do all this in preview mode.  And how do you get the value of the "length" of the column in the main table?

    Thanks.

    Tuesday, February 12, 2008 10:09 PM
  • The tricky thing is how to calculate the "table length" since maybe some fields is ntext and the content will be wrapped and take several line space while the report rendering...

    I use a "can grow" textbox to do the same trick by calculate how many CRLF I need to put in the textbox but I still have no clue... how to calculate the fields with wrapped content.
    Tuesday, October 28, 2008 5:15 PM
  • I have the same problem here , does anyone have a workable solution?

    If there is a textbox in the table with Can Grow set to true, how do you calucalate the length of preceding content?

    Monday, March 08, 2010 2:03 AM
  • This is just an idea, off the top of my head, but perhaps you can do the following:

    Make the following code changes

     

    Dim HeightSoFar As Decimal
    Dim LastLoggedPageNo As Integer
    
    Public Function LogHeight(NewHeight As Decimal, NewText as String)
      If Globals!PageNumber <> LastLoggedPageNo Then
        HeightSoFar = 0
      End If
      HeightSoFar = HeightSoFar + NewHeight
      Return NewText
    End Function

     

    Then make one textbox in every line on your report use

    =Code.LogHeight(txbWhatever.Height,MyValue)

    instead of

    =MyValue

    Then HeightSoFar will contain what you can pass to your subreport.

     

    Disclaimer: I'm incredibly new at SSRS :)
    We've gotten to using it as part of NAV 2009 and data-bound page-footers are used and requested often.

    Wednesday, April 14, 2010 8:18 AM
  • Huhhh?
    Monday, October 11, 2010 4:11 PM
  • Was a solution ever found for this issue. I'm trying to do the same thing. I'm new to SSRS and I need to set my bill stuff at the bottom of the page due to perforated paper being used when printing. I'm grouping and using a group header and footer.


    Susan

    Solved my issue: Reference Thread:

    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/413bdaa9-a579-4461-8e51-e90233939edb

    • Edited by sbrazier Friday, March 09, 2012 1:41 PM
    • Proposed as answer by Lee Everest Thursday, May 24, 2012 5:57 PM
    • Unproposed as answer by Lee Everest Thursday, May 24, 2012 5:57 PM
    • Proposed as answer by Serkan Apul Thursday, April 11, 2013 11:46 AM
    Sunday, February 26, 2012 8:18 PM
  • So, tnx solution seems fine, but w/o screenshots or steps I"m assuming that it's an idea not proven out. After reading I was perplexed as some of the other readers...sort of consider that a non-solution at this point.

    What I came up with was something much more palatable - if you read http://technet.microsoft.com/en-us/library/dd239352.aspx they mention the use of rectangles to create artificial borders inside of a report.  I took a rectangle and dragged my tablix inside of it; from there I tweaked and hacked a bit until I got the length of it to correctly place a footer regardless of the number of rows returned in the dataset. Also used a nice tip from here for report and body width.

    From this, I can create a template for use with future reports to keep the ubiquitous floating footer from returning.  Look for some screenshots and blogs at my SQL blog located at http://www.texastoo.com in the next few days.

    Thanks


    Lee Everest http://www.texastoo.com


    Thursday, May 24, 2012 6:07 PM
  • Simple solution:

    Insert a vertical line into the body of your report which forces the body to always be a minimum static height. Calculate as [Page Size] minus [Top and Bottom Margins + Header Size + Footer Size]. Then hide the line by setting the LineColor property to white (or same color as Report background color).

    • Proposed as answer by Craig MCSD Thursday, May 14, 2015 1:48 PM
    Thursday, May 14, 2015 1:45 PM
  • Can you explain this a bit further please?
    Thursday, March 16, 2017 7:28 AM