Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Page Headers?? Can this be done?

Status
Not open for further replies.

GolfNFool

Technical User
Jun 14, 2005
4
US
Hello,

I have combined 8 different metric reports into one report. Each metric has its own tablix and each tablix has the Page Break after set to ON.

What I was hoping to do was have different textboxes in the Page Header and be visible or not visible based on the tablix which is currently being viewed or at the top of the appropriate page when printed or exported to PDF.

Is there a way to know what tablix is live on that page? Is there another way to accomplish this?

Thanks.
 
I'm not sure there is but there may be a workaround

Create a parent table (not tablix) - stick each current tablix as a seperate row in the parent table

create a textbox in each row of the parent tablix above the child tablix and use this as your page header

Do not create a page header

Instead, go to the group properties of the parent table (a "detail" group will automatically be created) > Page Break ad tick the "between each instance of a goup" option

This will effectively create a page break after each row of your parent table (i.e. for each tablx inside that row and herefore the textbox will appear as a header on the page)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Geoff,

Thanks for the suggestion. I had already started down another path. I am on a server with R2 and am not sure if this is new with that patch, but I needed to fill three different text boxes differently based on which tablix was open on that page. I thus inserted all of this info into the PageName property and then in each text box I am parsing them back out by the seperators I inserted between each of the three items I placed in the PageName property.

It works well, but if I needed to change logo's or perform calculations in the footer or header, it would not work. I know people will argue that SSRS is a simple but powerful report writer, but almost every other report writer I have ever used was able to change things in the page headers and footers based upon a field on the report. Seems like this is something that should not have been overlooked for SSRS.
 
In this scenario, I would suggest actually using 1 tablix with a group on "type" (may need to be added to your main query)

Add type as a group in the tablix an set the page break properties of the group - this will effectively show 8 different tablix, 1 to a page

you can set the "type" fields to hidden so they do not appear on the report

Once this is set up you can use the ReportItems collection to identify which element of the group is shown on the page

e.g. f your "Type" group is in a field called tb_Type then you can use

=iif(ReportItems!tb_Type.value = "Type1","Show Text 1",iif(ReportItems!tb_Type.value = "Type2","Show Text 2"....etc etc

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top