Headers Not Repeating on New Page

  • Hi

    I have a table that I have set the headers to repeat on each page. This is fine if the detail rows spill on to another page but if is just the footer that is forced onto new page then the headers are absent.

    I should mention that I actually have a 2nd table in the footer of the 1st table although I am pretty sure this is not the cause of the problem.

    Any ideas?

  • Not sure I understand why you would want the headers if there is no more detail to show in that table, even though you obviously have your reasons, if I know the reason I might be able to help with an answer.

    Nigel West
    UK

  • Hi

    The headers still relate to the footer data so if the footer appears on a new page the headers ought to accompany it. Hope this answers your question.

  • I think I understand it now...

    So why don't you simply move the second table out of the footer of the first table and create it on it's own below the first table. This way you would have the headers you want on the second table, even if it's printed on it's own.

    Nigel West
    UK

  • Hi

    Yes, that is how I developed it originally. However, if the 2 tables appear on the same page, then you see the headers twice. It like I only want to view the headers of the 2nd table if it appears at the top of a new page.

    Ben

  • OK, so this is where SSRS starts getting a little bit tricky compared to Crystal Reports, where you have access to page numbers wherever you are in the report flow.

    Anyway, SSRS is what we have, so......

    The next question is: Are the row heights of table 1 fixed? And therefore, does that mean that you have a fixed number of rows that can appear on a single page? If this is the case then you could add headers to table 2 and only make them visible according to the count of rows printed in table 1.

    If (as is likely) they are not fixed height, then I'm struggling to find a solution, but I'll keep thinking about it.

    Nigel West
    UK

  • Hi

    I had thought of doing something like that too. The rows are fixed heights but the there are group headers and footers which take up space on the page as well and the number of these may vary.

    Appreciate your help.

  • Now I'm just throwing ideas around, but........

    Try adding a text box into the footer, and add just the page number to it.

    Name the Textbox CurrentPageNum.

    In the group footer of table 1 (and if you dont have a group footer, create one that just appears at the start and end of the table), add an expression to a cell like =ReportItems!CurrentPageNum.Value and name this cell LastDetailPage.

    Now......

    Add headers to your table 2 (the same headers as your table 1).

    In the visibility section, add the following expression:

    =IIF(ReportItems!CurrentPageNum.Value != ReportItems!LastDetailPage.Value,FALSE,TRUE)

    As I say, I'm really guessing here, and I certainly haven't tried it, but the logic itself works (I think).

    Nigel West
    UK

  • Mmm, appears I can't refer to footer report item in the report body.

  • OK, so my last stab at this one is as follows:

    Find a value (any value) that you can use as an outer grouping in your table. This value should not change (for example it will always be A for every row). This means that the header and footer of group 1 will show only at the start and end of the dataset.

    The header for group1 is not necessary, so remove it.

    Then, move your second table into the footer of group 1.

    This will hopefully mean that table 1 still thinks it's printing detailed information when it throws a page just before the group 1 footer, and therefore, the main headings will repeat for that page.

    Fingers crossed!

    Nigel West
    UK

  • That has cracked it, well done!

    RS is quirky sometimes, I would have thought that setting repeat header rows on new page applies to the WHOLE table not table minus footer!

    Thanks again.

  • Well we both managed to learn something today, and you're right, quirky is certainly one word you could use for SSRS!!

    Nigel West
    UK

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply