views:

155

answers:

3

I have a report that needs different header text on pages depending on the content of the page. Is there a way change the text in the header based on a piece of information on a page?

Page 1 header: ITINERARY

Page 2 header: ITINERARY

Page 3 header: FARE RULES

Page 4 header: RECEIPT

The other issue is that each section of information may be one or more pages long.

At the moment I've had to set out my report spacing out the pages and putting a dummy header at the start of each section.

What is the best way to do this?

A: 

Melissa,

You might be able to dynamically render the header content by using the Expression part of the header. Your logic might go something like this:

If ReportItems!Textvalue = "this", do "that"

When I mean the Expression part, right click on the textbox (assuming that's what you're using in the header) and change the expression from there. You also might want to look at the IIF (Immediate If) function too.

For example:

Dim i As Integer = 0 IIf(i = 0, "I am zero", "I am not zero")

Hopefully that should get you in the right direction as I employed a similar situation with Reporting Services last year.

coson

coson
A: 

Maybe you can find some info here: http://www.bigresource.com/MS_SQL-SSRS-Dynamic-Header-Jy99Q93u.html (scroll down to see more header-related links)

Or is this what you are looking for? http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/a82d32e1-2314-4c09-a828-6ce2109a0252

MarlonRibunal
A: 

What you could do is create each report section in its own separate report, then create a "Master" report that has all of the other reports as sub reports. Then all you'd have to do is put the headers on the master page.

DForck42