Dynamic Parent Header Based on Subreport
Hello All,Is it possible to alter the main report header based on the subreport being displayed in Reporting Services 2005/2008?Current Scenario: I currently have a main report "A" which contains a subreport "B". "B" contains five additional subreports.Main Report "A"Sub Report "B"Contains Additional Sub Reports "B(1) ... B(n)"The embedded subreports B(1) ... B(n) are configured to insert a page break before rendering. I modify the page headers through the use of an expression. The expression contains a switch statements that changes the header text based on hard coded page numbers. This works, but is quite ugly. If the subreports are modified in a manner which increases the number of pages, I need to modify the expression which can be quite cumbersome.The expression used currently is similar to the following: =Switch(Globals!PageNumber=1,"Summary-"&Parameters!HeaderInfo.Value ,Globals!PageNumber=2,"Summary-"&Parameters!HeaderInfo.Value ,Globals!PageNumber=3,"A"&Parameters!HeaderInfo.Value ,Globals!PageNumber=4,"A"&Parameters!HeaderInfo.Value ,Globals!PageNumber=5,"A"&Parameters!HeaderInfo.Value ,Globals!PageNumber=6,"B"&Parameters!HeaderInfo.Value ,Globals!PageNumber=7,"C"&Parameters!HeaderInfo.Value ,Globals!PageNumber=8,"C"&Parameters!HeaderInfo.Value ,Globals!PageNumber=9,"C"&Parameters!HeaderInfo.Value ,Globals!PageNumber=10,"C"&Parameters!HeaderInfo.Value ,Globals!PageNumber=11,"C"&Parameters!HeaderInfo.Value ,Globals!PageNumber=12,"D"&Parameters!HeaderInfo.Value ,Globals!PageNumber=13,"D"&Parameters!HeaderInfo.Value ,Globals!PageNumber=14,"E"&Parameters!HeaderInfo.Value ,Globals!PageNumber=15,"F"&Parameters!HeaderInfo.Value ,Globals!PageNumber=16,"F"&Parameters!HeaderInfo.Value ,Globals!PageNumber=17,"F"&Parameters!HeaderInfo.Value ,Globals!PageNumber=18,"F"&Parameters!HeaderInfo.Value ,Globals!PageNumber=19,"G"&Parameters!HeaderInfo.Value ,Globals!PageNumber=20,"H"&Parameters!HeaderInfo.Value ,Globals!PageNumber=21,"H"&Parameters!HeaderInfo.Value,1=1,"")Orlanzo
February 26th, 2009 9:50am

Is anyone from Microsoft going to reply to this? This is a very common question. I have a master report with a header that contains 20 subreports that make up the content of the report. I need to have the label in the parent header change based on the subreport that is showing on the current page. So for example, if I have an Income Statement sub report, then the parent header label should change to Income Statement when I am on the page that shows that subreport. If I cannot do this then I need to put a header into each and every sub report which is not good.
Free Windows Admin Tool Kit Click here and download it now
October 11th, 2012 8:13am

Hi Orlanzo, May be you can use the below approach for this kind of requirement, this solution depends on the way the design is created on your side.. can you post the design screenshot so that i can think of how to include the field w.r.t subreport and all Cheers, Arun Gangumalla Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful
October 11th, 2012 9:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics