views:

487

answers:

2

Hello there,

as reporting services are not very agile with page header/footers (like word is with sections) I am doing some hiding/showing of items which are all stacked in the page header. Currently I do a simple expression for visibility

IIF(Globals!Pagenumber = 2, True, False)

As I have growing tables beginning on page two I do not know on which page subsequent elements are.

Is there any way I could address these elements? Like "IIF page contains ReportElement!Tablix123 visibility = true". I do have page breaks before and after different tables so maybe I could address these in some way? All I need is a different header for different pages.

moontear

A: 

If the important thing is that a given header appears above a given table, then using page headers is probably not the best route.

Why not dispense with the header, and place you "header" items before the relevant table(s) in the report body?

EDIT Another alternative would be to use a subreport for each section - in place on one monolithic report - that might give you enough control over page headers

Ed Harper
I might look into subreports, but I really need different headers on different pages - it is not really dependent on a single table per page as there is more stuff.
moontear
A: 

from msdn :

A report can contain a header and footer that run along the top and bottom of each page, respectively. Headers and footers can contain expressions, static text, images, lines, rectangles, borders, background color, and background images. Expressions include dataset field references for reports with exactly one dataset and aggregate function calls that include the dataset as a scope.

> To display variable data that is different on each page, you must use an expression.

if you use sql server reporting service 2008 remote report, please check this solution:

add a arefrence to your report that contains a method that gives a page number and return the page header text. call this method from a textbox in report header. pass Globals!Pagenumber to this method.

masoud ramezani
that's what I am doing already - using expressions to hide stuff in the header based on pagenumber. not a good solution.
moontear