Groups | Blog | Home
all groups > sql server reporting services > september 2007 >

sql server reporting services : Repeat title on every page


Natasha
9/5/2007 9:12:02 PM
Hello all,
I'm trying to find solution to show sub-report title on every page of that
subreport.
What I have in the subreport is the text containing title and two tables
underneath.
The first table is a summary table and will only be shown on the first page.
The second table goes over few pages.
What I need is to get the title (which is above he first table) to show on
every page of that subreport, when exported to PDF.Instead its only shown on
the first page.
I have tried many things, nothing seems to work.
What should be the solution does NOT work: I have set a property on the
title text box to 'Repeat on every page with data region' , where data region
is set to be table 2.
Can anyone help me?

Many thanks


--
EMartinez
9/7/2007 4:13:12 AM
[quoted text, click to view]


You should be able to add a page header to the subreport (via 'Layout'
view in BIDS -> 'Report' drop-down menu -> 'Page Header'). This should
repeat on every page when exported to PDF. Hope this helps.

Regards,

Enrique Martinez
Sr. Software Consultant
Natasha
9/9/2007 5:36:00 PM
Hi Enrique,
I have tried using subreport headers before, but it doesnot show them at all
- this is another MRS limitation. Only main report headers and/or footers are
displayed.


[quoted text, click to view]
Parker
9/10/2007 4:49:20 AM
A little clumsy, but you could add an additional dataset in the main
report to provide the subreport heading that you want to repeat - if
you want values from it to appear in the actual header, you need to
use the following trick to show dataset values in the header (or
footer):

Go to Report|Report Properties menu.

Put code similar to the following into the Code tab (for each field
you plan on using in the header, add a global variable and a function
to return it and/or a parameter).

Sample:
Public Shared reportTitle As String
Public Shared reportName As String

Public Shared Function StoreHeaderInfo( title As String, name As
String) As String
reportTitle = title
reportName = name
' we need the assignment statement below, because method must return
something
' otherwise, we can't use it in a table cell or textbox
StoreHeaderInfo = ""
End Function

Then, in the body of the report, add a hidden textbox that has an
expression similar to this:

=Code.StoreHeaderInfo( Fields!ReportTitle.Value, Fields!
ReportName.Value )

Finally, in the header, put in a text box that has the expression:

=Code.reportName or =Code.reportTitle
Natasha
9/13/2007 5:00:01 PM
Hello Parker,
I'd like to thank you for your response.
Unfortunatelly, I couldnt get it to work using this approach.I'm not sure if
I understood where Function StoreHeaderInfo supposed to go to, into the code
of the main report, or subreport?
I have tried both, but it didnt work..
I could not use the header of the main report, as I didnt want to use the
same header accross all subreports. The main header works fine if it is to be
applied throughout all report (will be applied to all subreports)...from what
I could find is that it can only be hidden on the first and/or the last page
if required...I couldnt find a way to control it accross subreports....
If I try to make use of the header in the subreport , it doesnt work
again...this header is completelly ignored once I run the whole report.

This is what I did at the end:
I have modified table 2 and made table 1 part of the table 2 (created new
group in table one and placed table 1 into it)...
I have then added Title which I wanted to repeat into the table 2 header.

Thank you again!

[quoted text, click to view]
AddThis Social Bookmark Button